package com.example.game_level;



import org.andengine.engine.camera.Camera;
import org.andengine.engine.handler.timer.ITimerCallback;
import org.andengine.engine.handler.timer.TimerHandler;
import org.andengine.entity.IEntity;
import org.andengine.entity.IEntityFactory;
import org.andengine.entity.modifier.MoveXModifier;
import org.andengine.entity.modifier.MoveYModifier;
import org.andengine.entity.particle.ParticleSystem;
import org.andengine.entity.particle.emitter.PointParticleEmitter;
import org.andengine.entity.particle.initializer.VelocityParticleInitializer;
import org.andengine.entity.particle.modifier.AlphaParticleModifier;
import org.andengine.entity.particle.modifier.RotationParticleModifier;
import org.andengine.entity.primitive.Rectangle;
import org.andengine.entity.scene.Scene;
import org.andengine.entity.scene.background.Background;
import org.andengine.entity.sprite.Sprite;
import org.andengine.entity.text.Text;
import org.andengine.input.touch.TouchEvent;
import org.andengine.util.color.Color;




import android.util.FloatMath;
import android.graphics.Paint;
import android.util.Log;
import android.view.MotionEvent;
import android.widget.EditText;

public class GameScene extends Scene {// implements OnTouchListener {
	public Blocks block;
	Camera mCamera;
	float accelometerSpeedX;
	StartActivity activity;
	BlockLayer bl;
	String st,str;
	int bl_no,count=0;
	int c, one_brick;
//	int level=1;// level of the bricks 
	Color color_lev1[];
    
    int Flag=0,down_shift=0;;
    Paint paint = new Paint(Paint.ANTI_ALIAS_FLAG);
    Scene scene;
	Rectangle sprite;
    EditText mEdit;
    int positionX,positionY;
    Keyboard KeyBoard; 
    
    int timer=120;
	int nodeFlag=0;
	int waitFlag=0;
    int timerflag=0;
	int up_rowFlag=0;
	int land_flag=0;
	int color_flag=0;
	int Fill_flag=0;
	int Letter_flag=0;
	int swarCFlag=0;
	int KeyFlag=0;
	int showFlag=1;
	int previewflag=0;
	
    public void land_position(int row, Blocks bl,int position,Color c){
    	land_flag=1;
		switch(row){
		
		case 0: MoveYModifier moveDown_fs = new MoveYModifier(1, 120,408);
		        bl.sprite.registerEntityModifier(moveDown_fs);
	            activity.bricks_g0[1][position]=bl;break;
		case 1: MoveYModifier moveDown_s = new MoveYModifier(1, 120,367);
	            bl.sprite.registerEntityModifier(moveDown_s); 
	            activity.bricks_g0[2][position]=bl;break;
		case 2: MoveYModifier moveDown_t = new MoveYModifier(1, 120,326);
                bl.sprite.registerEntityModifier(moveDown_t);
                activity.bricks_g0[3][position]=bl; break;
		case 3: MoveYModifier moveDown_f = new MoveYModifier(1, 120,285);
                bl.sprite.registerEntityModifier(moveDown_f);
                activity.bricks_g0[4][position]=bl;break;
		case 4: MoveYModifier moveDown_fiv = new MoveYModifier(1, 120,244);
                bl.sprite.registerEntityModifier(moveDown_fiv); 
                activity.bricks_g0[5][position]=bl;break;
		case 5: //game close; accuracy
        	activity.setCurrentScene(new EndScene());break;
		
		}
		
		 activity.score=activity.score+10;
			score_update();
			
//			activity.fall.play();
			
			
	}
	
	// DISPLAY SCORE IN HINDI
	public void score_update(){
		int temp=activity.score;
		int num,i,j=0,position=610;
		
		String number[]=new String[10];
		String tem= new String();
		
		
		if(temp<=0){
		
			number[0]="\u0966";
			Rectangle sprite= new Rectangle(0,0,150,45, StartActivity.getSharedInstance().getVertexBufferObjectManager());
			sprite.setColor(1, 1, 1);
			sprite.setPosition(610, 0);
			attachChild(sprite);
			
			Text num_score= new Text(0, 0, activity.numFont, number[0] , activity.getVertexBufferObjectManager());
			num_score.setColor(0, 0, 0);
			num_score.setPosition(610,0);
			attachChild(num_score);
		}
		else
		{
			
		 for(i=0;temp>0;i++){
			num=temp%10;
			temp=temp/10;
			
			switch(num){
			
			case 0: number[i]="\u0966"; break;
			case 1: number[i]="\u0967"; break;
			case 2: number[i]="\u0968"; break;
			case 3: number[i]="\u0969"; break;
			case 4: number[i]="\u096A"; break;
			case 5: number[i]="\u096B"; break;
			case 6: number[i]="\u096C"; break;
			case 7: number[i]="\u096D"; break;
			case 8: number[i]="\u096E"; break;
			case 9: number[i]="\u096F"; break;
			}
			j=i;
	     	}
		 
		 
		 
			 
		 
		 Rectangle sprite= new Rectangle(0,0,150,45, StartActivity.getSharedInstance().getVertexBufferObjectManager());
		 sprite.setColor(1, 1, 1);
		 sprite.setPosition(610, 0);
		 attachChild(sprite);
			
		 for(;j>=0;j--){
			 
			 Text num_score= new Text(0, 0, activity.numFont, number[j], activity.getVertexBufferObjectManager());
			 num_score.setColor(0, 0, 0);
			 num_score.setPosition(position,0);
			 position+=20;
		     attachChild(num_score);
		 }
		 
			
			
           	
		}
		
	}
	
	
	
	
	// FOR MATCHING THE COLOR OF LETTER TO PREVIEW COLOR AND TO GENERATE NEW PREVIEW BLOCKS   
	public void color_match(int position,Letter_Blocks l){
		
		color_flag=1;
		switch(position){
		
		case 0:  l.sprite.setColor(activity.u_color1);
		         Blocks b1 = new Blocks(1);
		         b1.sprite.setPosition((float) (0*  b1.sprite.getWidth()*1.015)+3, 60);
		         attachChild(b1.sprite);
		         activity.letterblock[0].sprite.setColor(activity.u_color1);
		         activity.u_color1=b1.sprite.getColor();break;
		
		case 1:  l.sprite.setColor(activity.u_color2);
		         Blocks b2 = new Blocks(1);
		         b2.sprite.setPosition((float) ((1 % 7)*  b2.sprite.getWidth()*1.015)+3,60);
                 attachChild(b2.sprite);
                 activity.letterblock[1].sprite.setColor(activity.u_color2);
                 activity.u_color2=b2.sprite.getColor();break;
			
		case 2:  l.sprite.setColor(activity.u_color3);
		         Blocks b3 = new Blocks(1);
		         b3.sprite.setPosition((float) ((2 % 7)*  b3.sprite.getWidth()*1.015)+3,60);
                 attachChild(b3.sprite);
                 activity.letterblock[2].sprite.setColor(activity.u_color3);
                 activity.u_color3=b3.sprite.getColor(); 
		         break;
		
		case 3: l.sprite.setColor(activity.u_color4);
		        Blocks b4 = new Blocks(1);
		        b4.sprite.setPosition((float) ((3 % 7)*  b4.sprite.getWidth()*1.015)+3,60);
                attachChild(b4.sprite);
                activity.letterblock[3].sprite.setColor(activity.u_color4);
                activity.u_color4=b4.sprite.getColor();break;
		
		case 4: l.sprite.setColor(activity.u_color5);
		        Blocks b5 = new Blocks(1);
		        b5.sprite.setPosition((float) ((4 % 7)*  b5.sprite.getWidth()*1.015)+3,60);
                attachChild(b5.sprite);
                activity.letterblock[4].sprite.setColor(activity.u_color5);
                activity.u_color5=b5.sprite.getColor();break;
		
		case 5: l.sprite.setColor(activity.u_color6);
		        Blocks b6 = new Blocks(1);
		        b6.sprite.setPosition((float) ((5 % 7)*  b6.sprite.getWidth()*1.015)+3,60);
		        attachChild(b6.sprite);
		        activity.letterblock[5].sprite.setColor(activity.u_color6);
                activity.u_color6=b6.sprite.getColor();break;
		
		case 6: l.sprite.setColor(activity.u_color7);
		        Blocks b7 = new Blocks(1);
		        b7.sprite.setPosition((float) ((6 % 7)*  b7.sprite.getWidth()*1.015)+3,60);
		        attachChild(b7.sprite);
		        activity.letterblock[6].sprite.setColor(activity.u_color7);
                activity.u_color7=b7.sprite.getColor();break;
		}
		color_flag=0;
	}
	
	
	public void setLetter(int position,Letter_Blocks l,Blocks b){
		
		Letter_flag=1;
		switch(position){
		
		case 0:  b.sprite.setPosition((float) (0*  b.sprite.getWidth()*1.015)+3, 120);
		         attachChild(b.sprite);
			     l.sprite.setPosition((float) (0*  l.sprite.getWidth()*1.015)+3, 120);
                 attachChild(l.sprite);
                 break;
		
		case 1:  b.sprite.setPosition((float) (1*  b.sprite.getWidth()*1.015)+3, 120);
                 attachChild(b.sprite);
	     	     l.sprite.setPosition((float) (1*  l.sprite.getWidth()*1.015)+3, 120);
                 attachChild(l.sprite);
                 break;
		
		case 2:  b.sprite.setPosition((float) (2*  b.sprite.getWidth()*1.015)+3, 120);
                 attachChild(b.sprite);
			     l.sprite.setPosition((float) (2*  l.sprite.getWidth()*1.015)+3, 120);
                 attachChild(l.sprite);
                 break;

		case 3:  b.sprite.setPosition((float) (3*  b.sprite.getWidth()*1.015)+3, 120);
                 attachChild(b.sprite);
			     l.sprite.setPosition((float) (3*  l.sprite.getWidth()*1.015)+3, 120);
                 attachChild(l.sprite);
                 break;
                 
		case 4:  b.sprite.setPosition((float) (4*  b.sprite.getWidth()*1.015)+3, 120);
                 attachChild(b.sprite);
			     l.sprite.setPosition((float) (4*  l.sprite.getWidth()*1.015)+3, 120);
                 attachChild(l.sprite);
                 break;
                 
		case 5:  b.sprite.setPosition((float) (5*  b.sprite.getWidth()*1.015)+3, 120);
                 attachChild(b.sprite);
			     l.sprite.setPosition((float) (5*  l.sprite.getWidth()*1.015)+3, 120);
                 attachChild(l.sprite);
                 break;
                 
		case 6:  b.sprite.setPosition((float) (6*  b.sprite.getWidth()*1.015)+3, 120);
                 attachChild(b.sprite);
			     l.sprite.setPosition((float) (6*  l.sprite.getWidth()*1.015)+3, 120);
                 attachChild(l.sprite);
                 break;
                 
		}
		Letter_flag=0;
		
	}
	
	// REMOVES THE WHITE SPACES(DEAD BRICKS) AFTER EXPLOSION
	public void fill_spaces(){
		
		Fill_flag=1;
		for(int k=0;k<6;k++)
		for(int j=0;j<7;j++)
		{
			for(int i=6;i>0;i--){
				if(activity.bricks_g0[i][j].white==1 && activity.bricks_g0[i+1][j].white==0){
					
					Blocks b=new Blocks();
					b.sprite.setColor(1, 1, 1);
					b.sprite.setPosition((float) (j*  b.sprite.getWidth()*1.015)+3, activity.phy_position[i]);
					
					
					activity.bricks_g0[i][j]=activity.bricks_g0[i+1][j];
					activity.bricks_g0[i][j].white=0;
					MoveYModifier moveDown_t = new MoveYModifier(0.2f, activity.phy_position[i+1], activity.phy_position[i]);
					activity.bricks_g0[i+1][j].sprite.registerEntityModifier(moveDown_t);
	
					activity.bricks_g0[i+1][j]=b;
					activity.bricks_g0[i+1][j].white=1;
				}
			}
		}
		Fill_flag=0;
		
	}
	
	//EXPLODES A BRICK AT SPECIFIED X,Y
	public void explode(int position,int row){
		
		Blocks block=new Blocks();
		block.sprite.setPosition((float) (((position)*  block.sprite.getWidth()*1.015))+3,activity.phy_position[row]);
		block.sprite.setColor(1,1,1);
		attachChild(block.sprite);
		Log.v("the game", "GameScene blackbrick_attach white brick");
		
		createExplosion(block.sprite.getX(), block.sprite.getY(), block.sprite.getParent(),activity.bricks_g0[row][position] , StartActivity.getSharedInstance());

		activity.bricks_g0[row][position]=block;
		activity.bricks_g0[row][position].white=1;

		
		
		if(row==0){
			Blocks gblock=new Blocks();
			gblock.sprite.setPosition((float) (((position)*  block.sprite.getWidth()*1.015))+3,491);
			
			attachChild(gblock.sprite);
			
			 MoveYModifier moveUp_fs = new MoveYModifier(1, 491,449);
			 gblock.sprite.registerEntityModifier(moveUp_fs);
	         
			
			activity.bricks_g0[0][position]=gblock;
		}
		else
		
		if(activity.lev1[position]>0){
		activity.lev1[position]=activity.lev1[position]-1;
		Log.v("The_game", "blackbrick");
		
			}
		fill_spaces();	
	}
	
	// BLACK BRICK 
	public void blackBrick(final int position, final int row){
		
		explode(position,row-1);
		fill_spaces();
		explode(position,row);
		fill_spaces();
        //		fill_spaces();
        		
        		Blocks block=new Blocks();
        		block.sprite.setPosition((float) (((position)*  block.sprite.getWidth()*1.015))+3,activity.phy_position[row]);
        		block.sprite.setColor(1,1,1);
        		
        		if(position+1<7){
        			if(!block.sprite.getColor().equals(activity.bricks_g0[row][position+1].sprite.getColor()))
        					explode(position+1,row);
        				        
        		 			
        			if(row+1<7)
        			if(!block.sprite.getColor().equals(activity.bricks_g0[row+1][position+1].sprite.getColor()))
        				explode(position+1,row+1);
        			
        			
        			if(row-1>=0)
        				if(!block.sprite.getColor().equals(activity.bricks_g0[row-1][position+1].sprite.getColor()))
        					explode(position+1,row-1);
        			
        
        		}
        	
        		if(position-1>=0){
        			if(!block.sprite.getColor().equals(activity.bricks_g0[row][position-1].sprite.getColor()))
        					explode(position-1,row);
        			
        			
        			if(row+1<7)
        				if(!block.sprite.getColor().equals(activity.bricks_g0[row+1][position-1].sprite.getColor()))
        				explode(position-1,row+1);
        			
        			
        			if(row-1>=0)
        				if(!block.sprite.getColor().equals(activity.bricks_g0[row-1][position-1].sprite.getColor()))
        					explode(position-1,row-1);
        			
        			
        		}
        		
        	
        		  
		activity.getEngine().registerUpdateHandler(new TimerHandler(3,true, new ITimerCallback()		
 	 	
        {                      
            @Override
            public void onTimePassed(final TimerHandler pTimerHandler)
            {
            	fill_spaces();
            	activity.getEngine().unregisterUpdateHandler(pTimerHandler);
                
            }
        }));   
	 		
		
		
	
		
	}
	
	
	
	public void node(int positionr, Color cr, Blocks bl){
		Flag=1;
	  if(nodeFlag==0){  
		nodeFlag=1;
		up_rowFlag=1;
		Log.v("The_game", "node");
		
		final int position=positionr;
		Color black= new Color(0,0,0);
		
		
		activity.lev1[position]+=1;
		Log.v("The_game", "node_lev1+1");
		
		final int row= activity.lev1[position];
		final Color c=cr;
		final Blocks b=bl;
		land_position(row-1, b,position,c);
		if(activity.str.equalsIgnoreCase("\u0901")){
			callKeyboard();
			activity.str="";
		}
			
			
		//row=row+1;
		
		if(cr.equals(black)){
			
			activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	 	 	
	        {                      
	            @Override
	            public void onTimePassed(final TimerHandler pTimerHandler)
	            {
	            	blackBrick(position,row);
	            //	fill_spaces();
	        	//	fill_spaces();
	        		activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	            }
	        }));  
				
			
			
		}
		else{
		
		count=1;
//		final Color c=cr;
//		final Blocks b=bl;
		
	//	land_position(row-1, b,position,c);
		waitFlag=0;
       
		activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
 	 	
        {                      
            @Override
            public void onTimePassed(final TimerHandler pTimerHandler)
            {
                   
            	    Log.v("game_level", "dropmusic_timer");
            	    
            	    activity.fall.play();
            	    land_flag=0;
            	    
            	    if(position-1!=-1){ 
            		  left_Peer(position-1,row,c);
            		  Log.v("The_game", "left_peer");
            		}

            	    if(position+1!=7){
            		   right_Peer(position+1,row,c);
            		   Log.v("The_game", "right_peer");
            		}
            		
            		
            		if(row!=0)
            		 child(position,row-1,c);
            		 Log.v("The_game", "child_peer");
            		 

            		 if(count<3){
            			 
            			 activity.score=activity.score+10;
            		 }
            		 
            		 		 
            		if(count>=3){
            			 Flag=1;
            			
            			Blocks block=new Blocks();
            			block.sprite.setPosition((float) (((position)*  block.sprite.getWidth()*1.015))+3,activity.phy_position[row]);
            			block.sprite.setColor(1, 1, 1);
            				
            			attachChild(block.sprite);
            			
            			createExplosion(block.sprite.getX(), block.sprite.getY(), block.sprite.getParent(), b, StartActivity.getSharedInstance());
            			
            			activity.bricks_g0[row][position]=block;
            			activity.bricks_g0[row][position].sprite.setColor(1, 1, 1);
            			
            			if(activity.lev1[position]>0){
            				activity.lev1[position]=activity.lev1[position]-1;
            				}
            			
            			if(position-1!=-1){ 
            				  left_Peer(position-1,row,c);
            				  Log.v("The_game", "left_peer for count>3");
            				  fill_spaces();
            				}
            			if(position+1!=7){
            				   right_Peer(position+1,row,c);
            				   fill_spaces();
            				}
            			
            			activity.score=activity.score+(count*count*100);
            			score_update();
            		    if(count==3)
            		    	activity.collapse1.play();
            		    if(count>3) 
            		    	activity.collapse2.play();
            		    	
            		    fill_spaces();
            			
            			
            			
            			
            		    
            		}
            	    
            	    
            	    activity.getEngine().unregisterUpdateHandler(pTimerHandler);
            	   
                
            	
            }
            
        }));
		
		activity.getEngine().registerUpdateHandler(new TimerHandler(1.5f,true, new ITimerCallback()		
 	 	
        {                      
            @Override
            public void onTimePassed(final TimerHandler pTimerHandler)
            {

    			
            	up_rowFlag=1;
    			
            	for(int i=1;i<7;i++){
    				for(int j=0;j<7;j++){
    					Blocks bl=new Blocks();
    					bl.sprite.setColor(activity.bricks_g0[i][j].sprite.getColor());
    					bl.sprite.setPosition((float) (j*  block.sprite.getWidth()*1.015)+3, activity.phy_position[i]);
    					attachChild(bl.sprite);
    				}
    			}
        	    
            	Flag=0;
            	up_rowFlag=0;
            	nodeFlag=0;
            	    activity.getEngine().unregisterUpdateHandler(pTimerHandler);
            	   
            	    
            	
            }
            
        }));
        
        
		}
		waitFlag=0;
		

	  }
	  
	  
	}
	
	public void left_Peer(int position, int lt_row, Color c){
		Color left;
		
		left=activity.bricks_g0[lt_row][position].sprite.getColor();
		
		if((left.equals(c))&& (activity.bricks_g0[lt_row][position].alive==1)) {
			count++;
			
			activity.bricks_g0[lt_row][position].alive=0;
			
			
			
			if(position-1!=-1){
			left_Peer(position-1,lt_row,c);
			}
			
			if(lt_row!=0){
			child(position,lt_row-1,c);
			}
			
			parent(position,lt_row+1,c);
			
			if(count>=3){
				

				Blocks block=new Blocks();
				block.sprite.setPosition((float) (((position)*  block.sprite.getWidth()*1.015))+3,activity.phy_position[lt_row]);
				block.sprite.setColor(1,1,1);
				
				attachChild(block.sprite);
				Log.v("the game", "GameScene leftpeer_attach white brick");
				
				createExplosion(block.sprite.getX(), block.sprite.getY(), block.sprite.getParent(),activity.bricks_g0[lt_row][position] , StartActivity.getSharedInstance());

				activity.bricks_g0[lt_row][position]=block;
				activity.bricks_g0[lt_row][position].white=1;
	//			attachChild(activity.bricks_g0[lt_row][position].sprite);
				
				
				if(lt_row==0){
					Blocks gblock=new Blocks();
					gblock.sprite.setPosition((float) (((position)*  block.sprite.getWidth()*1.015))+3,491);
					
					attachChild(gblock.sprite);
					
					 MoveYModifier moveUp_fs = new MoveYModifier(1, 491,449);
					 gblock.sprite.registerEntityModifier(moveUp_fs);
			         
					
					activity.bricks_g0[0][position]=gblock;
				}
				else
				
				if(activity.lev1[position]>0){
				activity.lev1[position]=activity.lev1[position]-1;
				Log.v("The_game", "left");
				
					}
				
			}
			else activity.bricks_g0[lt_row][position].alive=1;
		}
		
		
	}
	
	public void right_Peer(int position, int rt_row, Color c){
        Color right;
		
		right=activity.bricks_g0[rt_row][position].sprite.getColor();
		
		if((c.equals(right))&&(activity.bricks_g0[rt_row][position].alive==1)){
			count++;
			
			activity.bricks_g0[rt_row][position].alive=0;
			
			
//			waittime();
			
			if(position+1!=7){
			right_Peer(position+1,rt_row,c);
			}
			
			if(rt_row!=0){
			child(position,rt_row-1,c);
			}
			
			parent(position,rt_row+1,c);
			
			if(count>=3){
	
				
				
				Blocks block=new Blocks();
				block.sprite.setPosition((float) (((position % 7)*  block.sprite.getWidth()*1.015)+3),activity.phy_position[rt_row]);
				block.sprite.setColor(1,1,1);
				
				attachChild(block.sprite);
				Log.v("the game", "GameScene right_peer_attach white brick");
				
				createExplosion(block.sprite.getX(), block.sprite.getY(), block.sprite.getParent(),activity.bricks_g0[rt_row][position] , StartActivity.getSharedInstance());
				
				activity.bricks_g0[rt_row][position]=block;
				activity.bricks_g0[rt_row][position].white=1;

//				attachChild(activity.bricks_g0[rt_row][position].sprite);
				
				

				
				if(rt_row==0){
					Blocks gblock=new Blocks();
					gblock.sprite.setPosition((float) (((position)*  block.sprite.getWidth()*1.015))+3,491);
					attachChild(gblock.sprite);
					
					 MoveYModifier moveUp_fs = new MoveYModifier(1, 491,449);
					 gblock.sprite.registerEntityModifier(moveUp_fs);
			         
					activity.bricks_g0[0][position]=gblock;
				}
				else
			if(activity.lev1[position]>0){
				activity.lev1[position]=activity.lev1[position]-1;
				Log.v("The_game", "right");
				
				
					}
//				fill_spaces();
			
			}
			else activity.bricks_g0[rt_row][position].alive=1;
		}
		
	}
	
	public void child(int position, int dn_row, Color c){
		Color down;
		down= activity.bricks_g0[dn_row][position].sprite.getColor();
		if((c.equals(down))&&(activity.bricks_g0[dn_row][position].alive==1)){
			count++;
			
			activity.bricks_g0[dn_row][position].alive=0;
            
			
	//		waittime();
			
		   if(position-1!=-1){				
			   left_Peer(position-1,dn_row,c);
			
			}
			
			if(position+1!=7){
				right_Peer(position+1,dn_row,c);
			}
			
			if(dn_row!=0){
				child(position,dn_row-1,c);
				
			}
			
			if(count>=3){

				
				
				Blocks block=new Blocks();
				block.sprite.setPosition((float) (((position % 7)*  block.sprite.getWidth()*1.015)+3),activity.phy_position[dn_row]);
				block.sprite.setColor(1,1,1);
				attachChild(block.sprite);
				Log.v("the game", "GameScene childpeer_attach white brick");
				
				createExplosion(block.sprite.getX(), block.sprite.getY(), block.sprite.getParent(),activity.bricks_g0[dn_row][position] , StartActivity.getSharedInstance());

				activity.bricks_g0[dn_row][position]=block;
				activity.bricks_g0[dn_row][position].white=1;
//				attachChild(activity.bricks_g0[dn_row][position].sprite);
				
				
				if(dn_row==0){
					Blocks gblock=new Blocks();
					gblock.sprite.setPosition((float) (((position)*  block.sprite.getWidth()*1.015))+3,491);
					
					attachChild(gblock.sprite);
					
					 MoveYModifier moveUp_fs = new MoveYModifier(1, 491,449);
					 gblock.sprite.registerEntityModifier(moveUp_fs);
			         
					activity.bricks_g0[0][position]=gblock;
					
				}
				else
			if(activity.lev1[position]>0){
				activity.lev1[position]=activity.lev1[position]-1;
				Log.v("The_game", "child");
				
	
					}
	//			fill_spaces();
			}
			else activity.bricks_g0[dn_row][position].alive=1;
		}
	}
	
	public void parent(int position, int up_row, Color c){
		if(up_row<6){
		Color up= activity.bricks_g0[up_row][position].sprite.getColor();
		
		if((c.equals(up))&&(activity.bricks_g0[up_row][position].alive==1)){
			count++;
			
			activity.bricks_g0[up_row][position].alive=0;
			
			
	//		waittime();
			
			if(position-1!=-1){
				left_Peer(position-1,up_row,c);
			}
            
			if(position+1!=7){
				right_Peer(position+1,up_row,c);
			}
			
            parent(position,up_row+1,c);
			
            if(count>=3){
       			Blocks block=new Blocks();
				block.sprite.setPosition((float) (((position % 7)*  block.sprite.getWidth()*1.015)+3),activity.phy_position[up_row]);
				block.sprite.setColor(c);
				attachChild(block.sprite);
				Log.v("the game", "GameScene parentpeer_attach white brick");
            	
				createExplosion( block.sprite.getX(),  block.sprite.getY(),  block.sprite.getParent(), activity.bricks_g0[up_row][position], StartActivity.getSharedInstance());
 
				activity.bricks_g0[up_row][position]=block;
				activity.bricks_g0[up_row][position].white=1;
//				attachChild(activity.bricks_g0[up_row][position].sprite);
				
				
				
				if(activity.lev1[position]>0){
				activity.lev1[position]=activity.lev1[position]-1;
				Log.v("The_game", "parent");
				}
//				fill_spaces();
			
				Blocks w=new Blocks();
				w.sprite.setPosition((float) (((position)*  block.sprite.getWidth()*1.015))+3,activity.phy_position[up_row]);
				w.sprite.setColor(1, 1, 1);
				
				attachChild(w.sprite);
			}
            else activity.bricks_g0[up_row][position].alive=1; 
		}
	}
	}
	
	//To create explosion
	
	private void createExplosion(final float posX, final float posY, final IEntity target, Blocks c, final StartActivity activity) {
	//	Flag=1;
		int mNumPart = 10;
		int mTimePart = 2;
		final Color color;
		color=c.sprite.getColor();

		PointParticleEmitter particleEmitter = new PointParticleEmitter(posX,posY);
		IEntityFactory recFact = new IEntityFactory() {
		    @Override
		    public Rectangle create(float pX, float pY) {
		        Rectangle rect = new Rectangle(posX, posY, 20, 20, activity.getVertexBufferObjectManager());
		        rect.setColor(color);
		        return rect;
		    }
		};
		final ParticleSystem particleSystem = new ParticleSystem( recFact, particleEmitter, 500, 500, mNumPart);
		
		particleSystem.addParticleInitializer(new VelocityParticleInitializer(-50, 50, -50, 50));
			 
			particleSystem.addParticleModifier(new AlphaParticleModifier(0,0.6f * mTimePart, 1, 0));
			particleSystem.addParticleModifier(new RotationParticleModifier(0, mTimePart, 0, 360));
			 
			target.attachChild(particleSystem);
		
			target.registerUpdateHandler(new TimerHandler(mTimePart, new ITimerCallback() {
			    @Override
			    public void onTimePassed(final TimerHandler pTimerHandler) {
			        particleSystem.detachSelf();
			        target.sortChildren();
			     
			        target.unregisterUpdateHandler(pTimerHandler);
			    }
			    
			}));
            
	//		Flag=0;
			
		}
	
	// deduct marks if wrong key is pressed
	public void deduct_score(){
		
		activity.score=activity.score-10;
		score_update();
		
	}
	
	
 	public void shift(){
 //		Flag=1;
 		for(int i=0;i<7;i++){
			 for(int j=0;j<7;j++){
				activity.bricks[i][j]= activity.bricks_g0[i][j];
			}
 		}
 		
 		 for(int j=0;j<7;j++){
				activity.lev[j]= activity.lev1[j];
			}
		
		Blocks b= new Blocks();
//		b.sprite.setColor(1, 1, 1);
		activity.lev1[6]=activity.lev1[0];
		
		 for(int i=0;i<6;i++){
			 
			for(int j=6;j>0;j--){
				  float initialPosX = (float) ((j % 7)*  b.sprite.getWidth()*1.015)+3 ;
				  float finalPosX= (float) (((j-1) % 7)*  b.sprite.getWidth()*1.015)+3;
				  Blocks temp=new Blocks();
				  temp.sprite.setColor(activity.bricks[i][j].sprite.getColor());
				  temp.sprite.setPosition(initialPosX, activity.phy_position[i]);
				  attachChild(temp.sprite);
				  
				  
				  if(i==0||j==0){
					  MoveXModifier moveRight_fs = new MoveXModifier(0.5f,initialPosX ,finalPosX);
					  temp.sprite.registerEntityModifier(moveRight_fs);
				  }
				  else{
					  MoveXModifier moveRight_fs = new MoveXModifier(0.5f,initialPosX ,finalPosX);
					  temp.sprite.registerEntityModifier(moveRight_fs);
					  
				  }
				  
				  activity.bricks_g0[i][j-1]=temp;
				  activity.bricks_g0[i][j-1].sprite.setColor(temp.sprite.getColor());
			//	  activity.bricks[i][j].sprite.setColor(1, 1, 1);
				  
		  			  
			  }
			float initialPosX = (float) ((7)*  b.sprite.getWidth()*1.015)+3 ;
			float finalPosX= (float) (((6) % 7)*  b.sprite.getWidth()*1.015)+3;
			  Blocks temp=new Blocks();
			  temp.sprite.setColor(activity.bricks[i][0].sprite.getColor());
			  temp.sprite.setPosition(initialPosX, activity.phy_position[i]);
			  attachChild(temp.sprite);
			  
			  
				  MoveXModifier moveRight_fs = new MoveXModifier(0.5f,initialPosX ,finalPosX);
				  temp.sprite.registerEntityModifier(moveRight_fs);	  
			  
			  
			  activity.bricks_g0[i][6]=temp;
			  activity.bricks_g0[i][6].sprite.setColor(temp.sprite.getColor());
			  
			  activity.lev1[i]=activity.lev[i+1];
				    
		  }
		  
		 for(int j=0;j<7;j++){
				activity.lev[j]= activity.lev1[j];
				
				
			}
		 for(int i=0;i<7;i++){
			 for(int j=0;j<7;j++){
				activity.bricks[i][j]= activity.bricks_g0[i][j];
			}
 		}
	//	 Flag=0;
	}
 	
 		public void add_new_row(){
		    up_rowFlag=1;
 			int i,j;
 			Color white= new Color(1,1,1);
 			for(i=0;i<7;i++){
 				if(!activity.bricks_g0[5][i].sprite.getColor().equals(white))
 					activity.setCurrentScene(new EndScene());
 			 }
		    

 			for(i=0;i<6;i++){
 				for(j=0;j<7;j++){
 					activity.bricks_up[i][j]=activity.bricks_g0[i][j];
 				}
 			}
 			
 			for(i=1;i<6;i++){
 				for(j=0;j<7;j++){
 					activity.bricks_g0[i][j]=activity.bricks_up[i-1][j];
 				}
 			}
 			
 			for ( i = 0; i < 7; i++) {
 				Blocks b = new Blocks();
 				activity.bricks_g0[0][i]= b;
 			}
	
 //			setPosition(3, 330);
 			
 			for ( i = 0; i < 7; i++) {
 				Blocks b = new Blocks();
 	//			Blocks w=new Blocks();
 	//			w.sprite.setColor(1, 1, 1);
 				b.sprite.setColor(activity.bricks_g0[0][i].sprite.getColor());
 				b.sprite.setPosition((float) ((i % 7)*  b.sprite.getWidth()*1.015)+3, 490);
 				attachChild(b.sprite);
 				MoveYModifier moveUp_fs = new MoveYModifier(0.5f, 490,449);
 				b.sprite.registerEntityModifier(moveUp_fs);
 				activity.lev1[i]+=1;
 			}
 			
 			for(i=1;i<6;i++){
 				for(j=0;j<7;j++){
 					Blocks b=new Blocks();
 					b.sprite.setColor(activity.bricks_g0[i][j].sprite.getColor());
 					b.sprite.setPosition((float) ((j % 7)*  b.sprite.getWidth()*1.015)+3, activity.phy_position[i-1]);
 					attachChild(b.sprite);
 					MoveYModifier moveup_fs = new MoveYModifier(0.5f,activity.phy_position[i-1] ,activity.phy_position[i]);
 					b.sprite.registerEntityModifier(moveup_fs);	
 				}
 				
 				
 			}
 			
 			
 	//		Flag=0;
	}
	
 		
 	 	// timer for shifting
 	 	
 	 	private void createTimeHandler()
 	 	{
 	 		
 	 		
 	  activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	 	 	
	        {                      
	            @Override
	            public void onTimePassed(final TimerHandler pTimerHandler)
	            {
	            	timer=timer-1;
	 	            	
	 	            	update_timer();
	 	            	
	 	          	
	            	
	            	
	            }
	        }));   
 	 		
 	     activity.getEngine().registerUpdateHandler(new TimerHandler(11,true, new ITimerCallback()		
 	 	
 	 	        {                      
 	 	            @Override
 	 	            public void onTimePassed(final TimerHandler pTimerHandler)
 	 	            {   Log.v("The_game", "shift_timer");
 	 	                if(timerflag==1)
 	 	                	activity.getEngine().unregisterUpdateHandler(pTimerHandler);
 	 	                
 	 	                //&&nodeFlag!=1&&waitFlag!=1&&timerflag!=1&&color_flag!=1&&Fill_flag!=1&&Letter_flag!=1&&showFlag!=0
 	 	                if(activity.level<3){
 	 	                	if(Flag!=1&&land_flag!=1){
 	 	 	            		activity.bgsound.play();
 	 	 	            		shift();
 	 	                	}
 	 	                	else
 	 	 	                		 activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
 	 	 	           	 	 	     {                      
 	 	 	           	               @Override
 	 	 	           	               public void onTimePassed(final TimerHandler pTimerHandler)
 	 	 	           	               {
 	 	 	           	                if(Flag!=1&&land_flag!=1){
 	 	 	 	                		activity.bgsound.play();
 	 	 	 	 	            		shift();
 	 	 	 	 	            	    activity.getEngine().unregisterUpdateHandler(pTimerHandler);
 	 	 	           	 	           }
 	 	 	           	            }
 	 	 	           	        })); 
 	 	                      
 	 	            	   }
 	 	                
 	 	                else{
 	 	                	if(previewflag==0&&land_flag!=1){
 	 	                		activity.bgsound.play();
 	 	 	            		shift();
 	 	                	}
 	 	                	else
 	 	                		 activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
 	 	           	 	 	     {                      
 	 	           	               @Override
 	 	           	               public void onTimePassed(final TimerHandler pTimerHandler)
 	 	           	               {
 	 	           	                if(previewflag==0&&land_flag!=1){
 	 	 	                		activity.bgsound.play();
 	 	 	 	            		shift();
 	 	 	 	            	    activity.getEngine().unregisterUpdateHandler(pTimerHandler);
 	 	           	 	           }
 	 	           	            }
 	 	           	        })); 
 	 	                }
 	 	            	
 	 	            }
 	 	          }));

     	   activity.getEngine().registerUpdateHandler(new TimerHandler(20,true, new ITimerCallback()		
 	 	 	
 	        {                      
 	            @Override
 	            public void onTimePassed(final TimerHandler pTimerHandler)
 	            {
 	            	if(timerflag==1)
 	            		activity.getEngine().unregisterUpdateHandler(pTimerHandler);
 	            	if(activity.level<3){
	 	                	for(;Flag!=1&&nodeFlag!=1&&waitFlag!=1&&timerflag!=1&&up_rowFlag!=1&&land_flag!=1&&color_flag!=1&&Fill_flag!=1&&Letter_flag!=1&&showFlag!=0;){
	 	 	            		
	 	 	            		add_new_row();
	 	 	 	            	break;
	 	                      }
	 	            	   }
	 	                
	 	                else{
	 	                	if(previewflag==0&&land_flag!=1){
	 	                		
	 	 	            		add_new_row();
	 	                	}
	 	                	else
	 	                		 activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	 	           	 	 	     {                      
	 	           	               @Override
	 	           	               public void onTimePassed(final TimerHandler pTimerHandler)
	 	           	               {
	 	           	                if(previewflag==0&&land_flag!=1){
	 	 	                		add_new_row();
	 	 	 	            	    activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	 	           	 	           }
	 	           	            }
	 	           	        })); 
	 	                }
	 	            	
	 	            }
	 	               
	 	            	
	 	            
	 	        }));
     	    if(activity.level<4){
     	  activity.getEngine().registerUpdateHandler(new TimerHandler(120,true, new ITimerCallback()		
	 	 	
	        {                      
	            @Override
	            public void onTimePassed(final TimerHandler pTimerHandler)
	            {
	            	 //activity.level+=1;
	            	   
	            	   timerflag=1;
	            	   activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	            
	                    activity.setCurrentScene(new EndScene());
	            	      Log.v("The_game", "game_timer");

	            	
	            	
	            }
	        }));
     	    }
     	    else{
     	    	activity.getEngine().registerUpdateHandler(new TimerHandler(240,true, new ITimerCallback()		
    	 	 	{                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	timerflag=1;
    	            	activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	                activity.setCurrentScene(new EndScene());
    	            	Log.v("The_game", "game_timer");

    	            	
    	            	
    	            }
    	        }));
     	    	
     	    }
 	 	}
	
	public void update_timer(){
		
		String number[]=new String[10];
	 		int i,temp=timer,num,position=360;
	 	
       
         	
         	
         	for(i=0;temp>0;i++){
    			num=temp%10;
    			temp=temp/10;
    			switch(num){
    			
    			case 0: number[i]="\u0966"; break;
    			case 1: number[i]="\u0967"; break;
    			case 2: number[i]="\u0968"; break;
    			case 3: number[i]="\u0969"; break;
    			case 4: number[i]="\u096A"; break;
    			case 5: number[i]="\u096B"; break;
    			case 6: number[i]="\u096C"; break;
    			case 7: number[i]="\u096D"; break;
    			case 8: number[i]="\u096E"; break;
    			case 9: number[i]="\u096F"; break;
    			}
    			
    	     	}
    		
    		
    			
    		
    		
    			Rectangle sprite= new Rectangle(0,0,100,45, StartActivity.getSharedInstance().getVertexBufferObjectManager());
    			sprite.setColor(1, 1, 1);
    			sprite.setPosition(360, 3);
    			attachChild(sprite);
    			
                     
                
         //       position=470;
    			for(i=i-1;i>=0;i--){
    				
    				Text time= new Text(0, 0, activity.tFont, number[i]  , activity.getVertexBufferObjectManager());
    				time.setColor(0, 0, 0);
    				time.setPosition(position,5);  //5
    				position+=20;       
    				attachChild(time);
    			}
    		
        
		
		
		
	}	
	public void on_click(int key,TouchEvent pSceneTouchEvent){
		switch(key){
		case 1:{
/*			Spritebutton playButton1 = new Spritebutton(activity.click, activity.hFont, "\u0915", 1, 1, 1,1);
			
//			if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_UP){
				playButton1.setPosition(116, 490);
				attachChild(playButton1);
        		
//        	}
//        	else{
    */    	Flag=1;
	    	Blocks block;
	    	if(activity.key[1]==1){ 
	    		Spritebutton playButton1 = new Spritebutton(activity.click, activity.hFont, "\u0915", 1, 1, 1,1);
	    		playButton1.setPosition(116, 490);
				attachChild(playButton1);
	    	    activity.pos=activity.position[0];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[0]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[0],l);
					
  
     		    setLetter( activity.position[0], l,block);
		    	
			    Color c= block.sprite.getColor();
			    
		    	node(activity.position[0],c, block );
			    activity.key[1]=0;
			    nodeFlag=0;
			    Log.v("LEVEL","key1");
			    detachChild(playButton1);
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;
    //    	}
		}break;
		
		case 2:{
			Flag=1;
	    	Blocks block;
	    	if(activity.key[2]==2){ 
	    		
	    	    activity.pos=activity.position[1];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[1]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[1],l);
				  
	    	    setLetter( activity.position[1], l,block);
		    	
	    	    Color c= block.sprite.getColor();
			    
		    	node(activity.position[1],c, block );
			    activity.key[2]=0;
	    	
			    nodeFlag=0;
			    Log.v("LEVEL","key2");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;
			                    
		
		}break;
		
		case 3:{
			Flag=1;
	    	Blocks block;
	    	if(activity.key[3]==3){ 
	    		
	    	    activity.pos=activity.position[2];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[2]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[2],l);
					
	    	
	    	    setLetter( activity.position[2], l,block);
		    
	    	    Color c= block.sprite.getColor();
			    
		    	node(activity.position[2],c, block );
			    activity.key[3]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key3");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;
		}break;
		
		
		case 4:{
			Flag=1;
	    	Blocks block;
	    	if(activity.key[4]==4){ 
	    		
	    	    activity.pos=activity.position[3];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[3]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[3],l);
	    	
	    	    setLetter( activity.position[3], l,block);
	    	    
	    	    Color c= block.sprite.getColor();
			    
		    	node(activity.position[3],c, block );
			    activity.key[4]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key4");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;
		}break;
			
		case 5:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[5]==5){ 
	    		
	    	    activity.pos=activity.position[4];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[4]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[4],l);
					
    	   
	    	    setLetter( activity.position[4], l,block);
	    	    Color c= block.sprite.getColor();
			    
		    	node(activity.position[4],c, block );
			    activity.key[5]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key5");
	    		
			    
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 6:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[6]==6){ 
	    		
	    	    activity.pos=activity.position[5];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[5]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[5],l);
	    	
	    	    setLetter( activity.position[5], l,block);

	    	    Color c= block.sprite.getColor();
			    
		    	node(activity.position[5],c, block );
			    activity.key[6]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key6");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 7:{
			Flag=1;
	    	Blocks block;
	    	if(activity.key[7]==7){ 
	    		
	    	    activity.pos=activity.position[6];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[6]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[6],l);

	    	    setLetter( activity.position[6], l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[6],c, block );
			    activity.key[7]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key7");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 8:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[8]==8){ 
	    		
	    	    activity.pos=activity.position[7];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[7]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[7],l);
					
    	
	    	    setLetter( activity.position[7], l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[7],c, block );
			    activity.key[8]=0;
			    
			    nodeFlag=0;
			    Log.v("LEVEL","key8");
	    		
	    	    
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 9:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[9]==9){ 
	    		
	    	    activity.pos=activity.position[8];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[8]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[8],l);
					
   	
	    	    setLetter( activity.position[8], l,block);

	    	    Color c= block.sprite.getColor();
			    
		    	node(activity.position[8],c, block );
			    activity.key[9]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key9");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 10:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[10]==10){ 
	    		
	    	    activity.pos=activity.position[9];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[9]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[9],l);
					

	    	    setLetter( activity.position[9], l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[9],c, block );
			    activity.key[10]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key10");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 11:{
			  Flag=1;
				 Blocks block;
				 if(activity.key[11]==11){ 
											    		
				   activity.pos=activity.position[10];
					block=new Blocks();
					block.sprite.setColor(activity.letterblock[activity.position[10]].sprite.getColor());
															
					Letter_Blocks l= new Letter_Blocks();
					color_match(activity.position[10],l);
															
										    	
					Color c= block.sprite.getColor();
						
					setLetter( activity.position[10], l,block);
					
					node(activity.position[10],c, block );
					activity.key[11]=0;
					
					nodeFlag=0;
				    Log.v("LEVEL","key11");
		    		
											    	    
				}
             else
			        deduct_score();   
			    Flag=0;

		}break;
		
		case 12:{
			Flag=1;
	    	Blocks block;
	    	if(activity.key[12]==12){ 
	    		
	    	    activity.pos=activity.position[11];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[11]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[11],l);
					

	    	    setLetter( activity.position[11], l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[11],c, block );
			    activity.key[12]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key12");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 13:{
			Flag=1;
	    	Blocks block;
	    	if(activity.key[13]==13){ 
	    		
	    	    activity.pos=activity.position[12];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[12]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[12],l);
					
	    	
	    	    setLetter( activity.position[12], l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[12],c, block );
			    activity.key[13]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key13");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;
		}break;
		
		case 14:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[14]==14){ 
	    		
	    	    activity.pos=activity.position[13];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[13]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[13],l);
					
	    	
		    	Color c= block.sprite.getColor();

		    	setLetter( activity.position[13], l,block);
		    	
		    	node(activity.position[13],c, block );
			    activity.key[14]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key14");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 15:{
			Flag=1;
	    	Blocks block;
	    	if(activity.key[15]==15){ 
	    		
	    	    activity.pos=activity.position[14];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[14]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[14],l);
					
	    	
	    	    setLetter( activity.position[14], l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[14],c, block );
			    activity.key[15]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key15");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 16:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[16]==16){ 
	    		
	    	    activity.pos=activity.position[15];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[15]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[15],l);
					
	    
	    	    setLetter( activity.position[15], l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[15],c, block );
			    activity.key[16]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key16");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
			
		case 17:{
			Flag=1;
	    	Blocks block;
	    	if(activity.key[17]==17){ 
	    		
	    	    activity.pos=activity.position[16];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[16]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[16],l);
					
	    	    setLetter( activity.position[16], l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[16],c, block );
			    activity.key[17]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key17");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 18:{
			Flag=1;
	    	Blocks block;
	    	if(activity.key[18]==18){ 
	    		
	    	    activity.pos=activity.position[17];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[17]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[17],l);
					

	    	    setLetter( activity.position[17], l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[17],c, block );
			    activity.key[18]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key18");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;
		}break;
		
		case 19:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[19]==19){ 
	    		
	    	    activity.pos=activity.position[18];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[18]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[18],l);
			

	    	    setLetter( activity.position[18], l,block);
	    	    
	    	    Color c= block.sprite.getColor();
			    
		    	node(activity.position[18],c, block );
			    activity.key[19]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key19");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
			
		case 20:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[20]==20){ 
	    		
	    	    activity.pos=activity.position[19];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[19]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[19],l);
					
		    
	    	    setLetter( activity.position[19], l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[19],c, block );
			    activity.key[20]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key20");
	    		
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		
		case 21:{
            Flag=1;
			 Blocks block;
			 if(activity.key[21]==21){ 
										    		
			   activity.pos=activity.position[20];
				block=new Blocks();
				block.sprite.setColor(activity.letterblock[activity.position[20]].sprite.getColor());
														
				Letter_Blocks l= new Letter_Blocks();
				color_match(activity.position[20],l);
														
					
				setLetter( activity.position[20], l,block);
				
				Color c= block.sprite.getColor();
												    
				node(activity.position[20],c, block );
				activity.key[21]=0;
				
				nodeFlag=0;
			    Log.v("LEVEL","key21");
	    		
										    	    
			}
           else
		        deduct_score();   
		    Flag=0;

		}break;
		
		case 22:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[22]==22){ 
	    		
	    	    activity.pos=activity.position[21];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[21]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[21],l);
					

	    	    setLetter( activity.position[21], l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[21],c, block );
			    activity.key[22]=0;
	    	 
			    nodeFlag=0;
			    Log.v("LEVEL","key22");
			    
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 23:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[23]==23){ 
	    		
	    	    activity.pos=activity.position[22];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[22]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[22],l);
					

			    
		    	Color c= block.sprite.getColor();

		    	setLetter( activity.position[22], l,block);
		    	
		    	node(activity.position[22],c, block );
			    activity.key[23]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key23");
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 24:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[24]==24){ 
	    		
	    	    activity.pos=activity.position[23];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[23]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[23],l);
					
	    	    setLetter( activity.position[23], l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[23],c, block );
			    activity.key[24]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key24");
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 25:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[25]==25){ 
	    		
	    	    activity.pos=activity.position[24];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[24]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[24],l);
					
	    	
	    	    setLetter( activity.position[24], l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[24],c, block );
			    activity.key[25]=0;
			    
			    nodeFlag=0;
			    Log.v("LEVEL","key25");
	    	    
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 26:{
	        
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[26]==26){ 
	    		
	    	    activity.pos=activity.position[25];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[25]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[25],l);
					
	    	
	    	    setLetter(activity.position[25],l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[25],c, block );
			    activity.key[26]=0;
			    
			    nodeFlag=0;
			    Log.v("LEVEL","key26");
	    	    
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 27:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[27]==27){ 
	    		
	    	    activity.pos=activity.position[26];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[26]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[26],l);
					
    	
	    	    setLetter(activity.position[26],l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[26],c, block );
			    activity.key[27]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key27");
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 28:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[28]==28){ 
	    		
	    	    activity.pos=activity.position[27];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[27]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[27],l);
					
	    	    setLetter(activity.position[27],l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[27],c, block );
			    activity.key[28]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key28");
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 29:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[29]==29){ 
	    		
	    	    activity.pos=activity.position[28];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[28]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[28],l);
					
	    	
	    	    setLetter(activity.position[28],l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[28],c, block );
			    activity.key[29]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key29");
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}
		break;
		
		case 30:{
        	Flag=1;
	    	Blocks block;
	    	if(activity.key[30]==30){ 
	    		
	    	    activity.pos=activity.position[29];
		    	block=new Blocks();
			    block.sprite.setColor(activity.letterblock[activity.position[29]].sprite.getColor());
					
		        Letter_Blocks l= new Letter_Blocks();
			    color_match(activity.position[29],l);
					
	    	
	    	    setLetter(activity.position[29],l,block);
	    	    
		    	Color c= block.sprite.getColor();
			    
		    	node(activity.position[29],c, block );
			    activity.key[30]=0;
	    	    
			    nodeFlag=0;
			    Log.v("LEVEL","key30");
	    		}
	    	    else
	    	    	deduct_score();   
	        Flag=0;

		}break;
		
		case 31:{
			Flag=1;
			Blocks block;
			if(activity.key[31]==31){ 
				    		
			activity.pos=activity.position[30];
			block=new Blocks();
			block.sprite.setColor(activity.letterblock[activity.position[30]].sprite.getColor());
								
			Letter_Blocks l= new Letter_Blocks();
			color_match(activity.position[30],l);
								
				    	
			setLetter(activity.position[30],l,block);

			Color c= block.sprite.getColor();
						    
			node(activity.position[30],c, block );
			activity.key[31]=0;
				    	    
			nodeFlag=0;
			Log.v("LEVEL","key31");
			}
			else
			deduct_score();   
			Flag=0;

		}break;
		
		case 32:{
			Flag=1;
			Blocks block;
			if(activity.key[32]==32){ 

			activity.pos=activity.position[31];
			block=new Blocks();
			block.sprite.setColor(activity.letterblock[activity.position[31]].sprite.getColor());

			Letter_Blocks l= new Letter_Blocks();
			color_match(activity.position[31],l);


			setLetter(activity.position[31],l,block);

			Color c= block.sprite.getColor();

			node(activity.position[31],c, block );
			activity.key[32]=0;

			nodeFlag=0;
			Log.v("LEVEL","key32");
			}
			else
			deduct_score();   
			Flag=0;
		}break;
		
		case 33:{
			Flag=1;
			Blocks block;
			if(activity.key[33]==33){ 

			activity.pos=activity.position[32];
			block=new Blocks();
			block.sprite.setColor(activity.letterblock[activity.position[32]].sprite.getColor());

			Letter_Blocks l= new Letter_Blocks();
			color_match(activity.position[32],l);


			setLetter(activity.position[32],l,block);

			Color c= block.sprite.getColor();

			node(activity.position[32],c, block );
			activity.key[33]=0;

			nodeFlag=0;
			Log.v("LEVEL","key33");
			}
			else
			deduct_score();   
			Flag=0;

		}break;
		
		case 34:{
			Flag=1;
			Blocks block;
			if(activity.key[34]==34){ 

			activity.pos=activity.position[33];
			block=new Blocks();
			block.sprite.setColor(activity.letterblock[activity.position[33]].sprite.getColor());

			Letter_Blocks l= new Letter_Blocks();
			color_match(activity.position[33],l);


			setLetter(activity.position[33],l,block);

			Color c= block.sprite.getColor();

			node(activity.position[33],c, block );
			activity.key[34]=0;

			nodeFlag=0;
			Log.v("LEVEL","key34");
			}
			else
			deduct_score();   
			Flag=0;

		}break;
		default:deduct_score();
		}
		
	}
	
	
	    	
	public void callKeyboard(){
		attachChild(new Keyboard(this,""));
	}



	public int findRegion(int radius2, int theta2) {
		
		int region=0;
		if(radius2<=35)
		{
			region =0;
		}
		
		
		else if(theta2>(0+18)&&theta2<=(36+18))
				region = 5;
	    else if(theta2>(36+18)&&theta2<=(72+18))
				region = 10;
		else if(theta2>(72+18)&&theta2<=(108+18))
				region = 1;
		else if(theta2>(108+18)&&theta2<(144+18))
				region = 2;
		else if(theta2>(144)&&theta2<=(180))
				region = 3;
		else if(theta2>-180&& theta2<=(-180+30))
			    region = 3;
			
		
		else if(theta2<(-144+18)&&theta2>(-180+18))
				region = 6;
		else if(theta2<(-108+18)&&theta2>=(-144+18))
				region = 7;
		else if(theta2<(-72+18)&&theta2>=(-108+18))
				region = 8;
		else if(theta2<(-36+18)&&theta2>(-72+18))
				region = 9;
		else if(theta2<(0+18) &&theta2>=(-36+18))
				region = 4;
		
//		else region=6;
	
			
	return region;
	}
	
	public void preview(String str, int theRegion, Swarchakra s){
		previewflag=1;
		int x=132,y=12;
		
		Rectangle grey_rect= new Rectangle(0,0,43,45, activity.getVertexBufferObjectManager());
		grey_rect.setColor(0.39843f,0.39843f,0.39843f);
        grey_rect.setPosition(x, y);
        
        
		switch(theRegion){
  		 
  		 case 0: s.attachChild(grey_rect);
  			     Text view=new Text(0,0,activity.numFont,str+activity.str,activity.getVertexBufferObjectManager());
		         view.setPosition(x+8, y-10);
	             s.attachChild(view);break;
	             
  		 case 1: 
  			final Swarchakra swarki = new Swarchakra(activity.mSwarki, activity.mFont, str, 0.4f, 0.4f, 0.4f,1);
            swarki.setPosition(x-133, y-12);
            s.attachChild(swarki);
            
  			     s.attachChild(grey_rect);
  		         if(activity.level>2){
  			     Text view1=new Text(0,0,activity.numFont,"\u093F"+str+activity.str,activity.getVertexBufferObjectManager());
                 view1.setPosition(x,y-12);
                 s.attachChild(view1);
  		         }break;
                
  		 case 2: //A
  			
  			 final Swarchakra swarka = new Swarchakra(activity.mSwarka, activity.mFont, str, 0.4f, 0.4f, 0.4f,1);
  	         swarka.setPosition(x-133, y-12);
  	         s.attachChild(swarka);
  	         
  			     s.attachChild(grey_rect);
  		         if(activity.level>2){
		         Text view2=new Text(0,0,activity.numFont,str+"\u093E",activity.getVertexBufferObjectManager());
                 view2.setPosition(x+3, y-15);
                 s.attachChild(view2);
  		         }break;
                
  		 case 3: //HALANT
  			     final Swarchakra swar = new Swarchakra(activity.mSwarhalant, activity.mFont, str, 0.4f, 0.4f, 0.4f,1);
  	             swar.setPosition(x-133, y-12);
  	             s.attachChild(swar);
  	             s.attachChild(grey_rect);
	             if(activity.level>3){
                 Text view3=new Text(0,0,activity.numFont,str+"\u094D"+activity.str,activity.getVertexBufferObjectManager());
                 view3.setPosition(x+8,y-13);
                 s.attachChild(view3);
  	             }break;
                
  		 case 4: //UU
  			     final Swarchakra swaruu = new Swarchakra(activity.mSwarkuu, activity.numFont, str, 0.4f, 0.4f, 0.4f,1);
	             swaruu.setPosition(x-133, y-12);
	             s.attachChild(swaruu);
	             
  			     s.attachChild(grey_rect);
  		         if(activity.level>2){
                 Text view4=new Text(0,0,activity.numFont,str+"\u0942"+activity.str,activity.getVertexBufferObjectManager());
                 view4.setPosition(x+8, y-13);
                 s.attachChild(view4);
  		         }break;
                
  		 case 5: //U
  			final Swarchakra swaru = new Swarchakra(activity.mSwarku, activity.mFont, str, 0.4f, 0.4f, 0.4f,1);
            swaru.setPosition(x-133, y-12);
            s.attachChild(swaru);
            s.attachChild(grey_rect);
  		         if(activity.level>2){
                 Text view5=new Text(0,0,activity.numFont,str+"\u0941"+activity.str,activity.getVertexBufferObjectManager());
                 view5.setPosition(x+8,y-13);
                 s.attachChild(view5);
  		         }break;
                
  		 case 6: //O
  			final Swarchakra swaroo = new Swarchakra(activity.mSwarkoo, activity.mFont, str, 0.4f, 0.4f, 0.4f,1);
            swaroo.setPosition(x-133, y-12);
            s.attachChild(swaroo);
  			 
  			     s.attachChild(grey_rect);
  		         if(activity.level>3){
                 Text view6=new Text(0,0,activity.numFont,str+"\u094C",activity.getVertexBufferObjectManager());
                 view6.setPosition(x, y-10);
                 s.attachChild(view6);
  		         }break;
                
  		 case 7: //OO
  			final Swarchakra swaro = new Swarchakra(activity.mSwarko, activity.mFont, str, 0.4f, 0.4f, 0.4f,1);
            swaro.setPosition(x-133, y-12);
            s.attachChild(swaro);
            
            
  			     s.attachChild(grey_rect);
  		         if(activity.level>3){
                 Text view7=new Text(0,0,activity.numFont,str+"\u094B",activity.getVertexBufferObjectManager());
                 view7.setPosition(x, y-10);
                 s.attachChild(view7);
  		         }break;
              
  		 case 8: //aay
  			final Swarchakra swaraeyy = new Swarchakra(activity.mSwaraeyy, activity.mFont, str, 0.4f, 0.4f, 0.4f,1);
            swaraeyy.setPosition(x-133, y-12);
            s.attachChild(swaraeyy);
            
  			     s.attachChild(grey_rect);
  		         if(activity.level>3){
                 Text view8=new Text(0,0,activity.numFont,str+"\u0948",activity.getVertexBufferObjectManager());
                 view8.setPosition(x+8,y-10);
                 s.attachChild(view8);
  		         }break;
               
  		 case 9: //ay
  			final Swarchakra swaraey = new Swarchakra(activity.mSwaraey, activity.mFont, str, 0.4f, 0.4f, 0.4f,1);
            swaraey.setPosition(x-133, y-12);
            s.attachChild(swaraey);
            
  			     s.attachChild(grey_rect);
  		         if(activity.level>3){ 
                 Text view9=new Text(0,0,activity.numFont,str+"\u0947",activity.getVertexBufferObjectManager());
                 view9.setPosition(x+8,y-10);
                 s.attachChild(view9);
  		         }break;
                
  		 case 10: //EE
  			final Swarchakra swarkii = new Swarchakra(activity.mSwarkii, activity.mFont, str, 0.4f, 0.4f, 0.4f,1);
            swarkii.setPosition(x-133, y-12);
            s.attachChild(swarkii);
            
  			      s.attachChild(grey_rect);
  		          if(activity.level>2){
                  Text view10=new Text(0,0,activity.numFont,str+"\u0940",activity.getVertexBufferObjectManager());
                  view10.setPosition(x,y-10);
                  s.attachChild(view10);
  		          }break;
  		 }
		
	}

	
	public void swarchakra(int key){
		
		if(swarCFlag==0){
			swarCFlag=1;
		switch(key){
		
		case 1:{
		final Swarchakra swarButton1 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0915", 0.4f, 0.4f, 0.4f,1){
            @Override
            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
            	int x=0,y=0;
        		int radius=0,theta=0,theRegion;
        		
        		
        		
            	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE){
            	
            		
            		 x= (int) ((int)pSceneTouchEvent.getX()-172);
               		 y=(int) ((int)pSceneTouchEvent.getY()-532);
               		 radius = (int) Math.sqrt((x*x)+(y*y));
               		 theta =(int) Math.toDegrees(Math.atan2(x,y));
               		 theRegion = findRegion(radius,theta);
               		 preview("\u0915",theRegion,this);
               		
            		 
               		 
            	}
            	else
            	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
            		unregisterTouchArea(this);
	            	showFlag=0;
	            	previewflag=0;
            	 x= (int) ((int)pSceneTouchEvent.getX()-172);
           		 y=(int) ((int)pSceneTouchEvent.getY()-532);
           		 radius = (int) Math.sqrt((x*x)+(y*y));
           		 theta =(int) Math.toDegrees(Math.atan2(x,y));
           		 theRegion = findRegion(radius,theta);
            		
	            
            		switch(theRegion){
            		case 0:
            			if(activity.key[1]==1){
                        	
                        	KeyFlag=1;	
                       
                         	activity.pos=activity.position[0];
            		    	block=new Blocks();
            			    block.sprite.setColor(activity.letterblock[activity.position[0]].sprite.getColor());
            					
            		        Letter_Blocks l= new Letter_Blocks();
            			    color_match(activity.position[0],l);
            					
            			    setLetter( activity.position[0], l,block);
            		    	
            			    Color c= block.sprite.getColor();
            			    
            		    	node(activity.position[0],c, block );
            			    activity.key[1]=0;
            			    nodeFlag=0;
            			    Log.v("LEVEL","key1");
            			}break;
            			
            			
            			
            		case 1: 
            			if( activity.key[36]==36){
            				KeyFlag=1;	
                            
                         	activity.pos=activity.position[35];
            		    	block=new Blocks();
            			    block.sprite.setColor(activity.letterblock[activity.position[35]].sprite.getColor());
            					
            		        Letter_Blocks l= new Letter_Blocks();
            			    color_match(activity.position[35],l);
            					
            			    setLetter( activity.position[35], l,block);
            		    	
            			    Color c= block.sprite.getColor();
            			    
            		    	node(activity.position[35],c, block );
            			    activity.key[36]=0;
            			    nodeFlag=0;
            			    Log.v("LEVEL","ki");
            			}break;
            			

            			
            		case 2:
            			if( activity.key[35]==35 ){
            				KeyFlag=1;	
                            
                         	activity.pos=activity.position[34];
            		    	block=new Blocks();
            			    block.sprite.setColor(activity.letterblock[activity.position[34]].sprite.getColor());
            					
            		        Letter_Blocks l= new Letter_Blocks();
            			    color_match(activity.position[34],l);
            					
            			    setLetter( activity.position[34], l,block);
            		    	
            			    Color c= block.sprite.getColor();
            			    
            		    	node(activity.position[34],c, block );
            			    activity.key[35]=0;
            			    nodeFlag=0;
            			    Log.v("LEVEL","kA");
            			}break;
            			
            		case 8:
            			if( activity.key[39]==39 && activity.level!=3 ){
            				KeyFlag=1;	
                            
                         	activity.pos=activity.position[38];
            		    	block=new Blocks();
            			    block.sprite.setColor(activity.letterblock[activity.position[38]].sprite.getColor());
            					
            		        Letter_Blocks l= new Letter_Blocks();
            			    color_match(activity.position[38],l);
            					
            			    setLetter( activity.position[38], l,block);
            		    	
            			    Color c= block.sprite.getColor();
            			    
            		    	node(activity.position[38],c, block );
            			    activity.key[39]=0;
            			    nodeFlag=0;
            			    Log.v("LEVEL","kAy");
            			}break;
            			
            		case 9:
            			if( activity.key[38]==38&& activity.level!=3){
            				KeyFlag=1;	
                            
                         	activity.pos=activity.position[37];
            		    	block=new Blocks();
            			    block.sprite.setColor(activity.letterblock[activity.position[37]].sprite.getColor());
            					
            		        Letter_Blocks l= new Letter_Blocks();
            			    color_match(activity.position[37],l);
            					
            			    setLetter( activity.position[37], l,block);
            		    	
            			    Color c= block.sprite.getColor();
            			    
            		    	node(activity.position[37],c, block );
            			    activity.key[38]=0;
            			    nodeFlag=0;
            			    Log.v("LEVEL","ke");
            			}break;
            			
            		case 10:
            	
            			if( activity.key[37]==37 ){
            				KeyFlag=1;	
                            
                         	activity.pos=activity.position[36];
            		    	block=new Blocks();
            			    block.sprite.setColor(activity.letterblock[activity.position[36]].sprite.getColor());
            					
            		        Letter_Blocks l= new Letter_Blocks();
            			    color_match(activity.position[36],l);
            					
            			    setLetter( activity.position[36], l,block);
            		    	
            			    Color c= block.sprite.getColor();
            			    
            		    	node(activity.position[36],c, block );
            			    activity.key[37]=0;
            			    nodeFlag=0;
            			    Log.v("LEVEL","kii");
            			}break;
 /*-------------------------------------------------------------------------------------------------------------------------*/
            		
            		case 3:
            			if( activity.key[205]==205&& activity.level!=3){
            				KeyFlag=1;	
                            
                         	activity.pos=activity.position[204];
            		    	block=new Blocks();
            			    block.sprite.setColor(activity.letterblock[activity.position[204]].sprite.getColor());
            					
            		        Letter_Blocks l= new Letter_Blocks();
            			    color_match(activity.position[204],l);
            					
            			    setLetter( activity.position[204], l,block);
            		    	
            			    Color c= block.sprite.getColor();
            			    
            		    	node(activity.position[204],c, block );
            			    activity.key[205]=0;
            			    nodeFlag=0;
            			    Log.v("LEVEL","halant");
            			}break;
            			
            		case 4:
            			if( activity.key[206]==206 ){
            				KeyFlag=1;	
                            
                         	activity.pos=activity.position[205];
            		    	block=new Blocks();
            			    block.sprite.setColor(activity.letterblock[activity.position[205]].sprite.getColor());
            					
            		        Letter_Blocks l= new Letter_Blocks();
            			    color_match(activity.position[205],l);
            					
            			    setLetter( activity.position[205], l,block);
            		    	
            			    Color c= block.sprite.getColor();
            			    
            		    	node(activity.position[205],c, block );
            			    activity.key[206]=0;
            			    nodeFlag=0;
            			    Log.v("LEVEL","uu");
            			}break;
            			
            		case 5:
            			if( activity.key[207]==207 ){
            				KeyFlag=1;	
                            
                         	activity.pos=activity.position[206];
            		    	block=new Blocks();
            			    block.sprite.setColor(activity.letterblock[activity.position[206]].sprite.getColor());
            					
            		        Letter_Blocks l= new Letter_Blocks();
            			    color_match(activity.position[206],l);
            					
            			    setLetter( activity.position[206], l,block);
            		    	
            			    Color c= block.sprite.getColor();
            			    
            		    	node(activity.position[206],c, block );
            			    activity.key[207]=0;
            			    nodeFlag=0;
            			    Log.v("LEVEL","u");
            			}break;
            			
            		case 6:
            			if( activity.key[208]==208 && activity.level!=3){
            				KeyFlag=1;	
                            
                         	activity.pos=activity.position[207];
            		    	block=new Blocks();
            			    block.sprite.setColor(activity.letterblock[activity.position[207]].sprite.getColor());
            					
            		        Letter_Blocks l= new Letter_Blocks();
            			    color_match(activity.position[207],l);
            					
            			    setLetter( activity.position[207], l,block);
            		    	
            			    Color c= block.sprite.getColor();
            			    
            		    	node(activity.position[207],c, block );
            			    activity.key[208]=0;
            			    nodeFlag=0;
            			    Log.v("LEVEL","awe");
            			}break;
            			
            		case 7:
            			if( activity.key[209]==209 && activity.level!=3){
            				KeyFlag=1;	
                            
                         	activity.pos=activity.position[208];
            		    	block=new Blocks();
            			    block.sprite.setColor(activity.letterblock[activity.position[208]].sprite.getColor());
            					
            		        Letter_Blocks l= new Letter_Blocks();
            			    color_match(activity.position[208],l);
            					
            			    setLetter( activity.position[208], l,block);
            		    	
            			    Color c= block.sprite.getColor();
            			    
            		    	node(activity.position[208],c, block );
            			    activity.key[209]=0;
            			    nodeFlag=0;
            			    Log.v("LEVEL","o");
            			}break;
            			
            			
            			
            		}
            	}

            	
            	
            	
        //    	 swarCFlag=0;
            	return true;
		
	}
	
		};
		 swarButton1.setPosition(3, 325 );
		 this.registerTouchArea(swarButton1);
		 this.attachChild(swarButton1);
		 
		 
	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	 	 	
	        {                      
	            @Override
	            public void onTimePassed(final TimerHandler pTimerHandler)
	            {
	            	if(showFlag==0){
	            	unregisterTouchArea(swarButton1);
	            	detachChild(swarButton1);
	            	showFlag=1;
	            	swarCFlag=0;
	            	activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	            	}
	            }
	        })); 
	     
			 }break;
	        
	        
		case 2:{
			final Swarchakra swarButton2 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0916", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
	            	
	            	
			Flag=1;
	    	Blocks block;
	    	
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		
        		 x= (int) ((int)pSceneTouchEvent.getX()-285);
           		 y=(int) ((int)pSceneTouchEvent.getY()-532);
           		 radius = (int) Math.sqrt((x*x)+(y*y));
           		 theta =(int) Math.toDegrees(Math.atan2(x,y));
           		 theRegion = findRegion(radius,theta);
           		 preview("\u0916",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-285);
       		 y=(int) ((int)pSceneTouchEvent.getY()-532);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[2]==2 ){ 
        	    		
        	    	    activity.pos=activity.position[1];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[1]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[1],l);
        				  
        	    	    setLetter( activity.position[1], l,block);
        		    	
        	    	    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[1],c, block );
        			    activity.key[2]=0;
        	    	
        			    nodeFlag=0;
        			    Log.v("LEVEL","key2");
        			    
        	    		}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[41]==41 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[40];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[40]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[40],l);
        					
        			    setLetter( activity.position[40], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[40],c, block );
        			    activity.key[41]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[40]==40 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[39];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[39]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[39],l);
        					
        			    setLetter( activity.position[39], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[39],c, block );
        			    activity.key[40]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[44]==44 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[43];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[43]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[43],l);
        					
        			    setLetter( activity.position[43], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[43],c, block );
        			    activity.key[44]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[43]==43&& activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[42];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[42]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[42],l);
        					
        			    setLetter( activity.position[42], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[42],c, block );
        			    activity.key[43]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[42]==42){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[41];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[41]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[41],l);
        					
        			    setLetter( activity.position[41], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[41],c, block );
        			    activity.key[42]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[210]==210&& activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[209];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[209]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[209],l);
        					
        			    setLetter( activity.position[209], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[209],c, block );
        			    activity.key[210]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[211]==211){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[210];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[210]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[210],l);
        					
        			    setLetter( activity.position[210], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[210],c, block );
        			    activity.key[211]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[212]==212 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[211];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[211]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[211],l);
        					
        			    setLetter( activity.position[211], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[211],c, block );
        			    activity.key[212]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[213]==213 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[212];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[212]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[212],l);
        					
        			    setLetter( activity.position[212], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[212],c, block );
        			    activity.key[213]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[214]==214 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[213];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[213]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[213],l);
        					
        			    setLetter( activity.position[213], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[213],c, block );
        			    activity.key[214]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;
        			
        		
        			
        			
        			
        			
        			
        			
        			
        			
        			
        		}
        	}
	    	
	    	
	    	
	    	
	    	
	    	
	    	Flag=0;
	//        swarCFlag=0;
	        return true;
			
	        	}
	        	
	        		};
	        		 swarButton2.setPosition(120, 315 );
	        		 this.registerTouchArea(swarButton2);
	        		 this.attachChild(swarButton2);
	        		 
	        	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	        	 	 	
	        	        {                      
	        	            @Override
	        	            public void onTimePassed(final TimerHandler pTimerHandler)
	        	            {
	        	            	if(showFlag==0){
	        	            	unregisterTouchArea(swarButton2);
	        	            	detachChild(swarButton2);
	        	            	showFlag=1;
	        	            	swarCFlag=0;
	        	            	activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	        	            	}
	        	            }
	        	        })); 
	        	      this.setTouchAreaBindingOnActionMoveEnabled(true);
	      		
	      			    	     
		}break;
	        	        
		
		case 3:{
			final Swarchakra swarButton3 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0917", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
	            	
	            	Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        		
        		x= (int) ((int)pSceneTouchEvent.getX()-398);
          		y=(int) ((int)pSceneTouchEvent.getY()-532);
          		radius = (int) Math.sqrt((x*x)+(y*y));
          		theta =(int) Math.toDegrees(Math.atan2(x,y));
          		theRegion = findRegion(radius,theta);
        		preview("\u0917",theRegion,this);
        		
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-398);
       		 y=(int) ((int)pSceneTouchEvent.getY()-532);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[3]==3){ 
        	    		
        	    	    activity.pos=activity.position[2];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[2]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[2],l);
        					
        	    	
        	    	    setLetter( activity.position[2], l,block);
        		    
        	    	    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[2],c, block );
        			    activity.key[3]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key3");
        	    		
        	    		}   break;
        			
        			
        			
        		case 1: 
        			if( activity.key[46]==46 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[45];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[45]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[45],l);
        					
        			    setLetter( activity.position[45], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[45],c, block );
        			    activity.key[46]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ki");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[45]==45 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[44];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[44]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[44],l);
        					
        			    setLetter( activity.position[44], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[44],c, block );
        			    activity.key[45]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kA");
        			}break;
        			
        		case 8:
        			if( activity.key[49]==49 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[48];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[48]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[48],l);
        					
        			    setLetter( activity.position[48], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[48],c, block );
        			    activity.key[49]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[48]==48 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[47];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[47]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[47],l);
        					
        			    setLetter( activity.position[47], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[47],c, block );
        			    activity.key[48]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ke");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[47]==47){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[46];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[46]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[46],l);
        					
        			    setLetter( activity.position[46], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[46],c, block );
        			    activity.key[47]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		case 3:
        			if( activity.key[215]==215 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[214];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[214]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[214],l);
        					
        			    setLetter( activity.position[214], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[214],c, block );
        			    activity.key[215]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[216]==216){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[215];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[215]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[215],l);
        					
        			    setLetter( activity.position[215], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[215],c, block );
        			    activity.key[216]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[217]==217){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[216];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[216]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[216],l);
        					
        			    setLetter( activity.position[216], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[216],c, block );
        			    activity.key[217]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[218]==218 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[217];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[217]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[217],l);
        					
        			    setLetter( activity.position[217], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[217],c, block );
        			    activity.key[218]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[219]==219 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[218];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[218]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[218],l);
        					
        			    setLetter( activity.position[218], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[218],c, block );
        			    activity.key[219]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;
        			
        		}
        	}

        	
	    	
	    	
	    	
	    	
	    	
	    	
	        Flag=0;
//	        swarCFlag=0;

	        return true;
			
	        	}
	        	
	        		};
	        		 swarButton3.setPosition(237, 315 );
	        		 this.registerTouchArea(swarButton3);
	        		 this.attachChild(swarButton3);
	        		 
	        	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	        	 	 	
	        	        {                      
	        	            @Override
	        	            public void onTimePassed(final TimerHandler pTimerHandler)
	        	            {
	        	              if(showFlag==0){
	        	            	unregisterTouchArea(swarButton3);
	        	            	detachChild(swarButton3);
	        	            	showFlag=1;
	        	            	swarCFlag=0;
	        	            	activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	        	            	}
	        	            }
	        	        })); 
	        	      }break;
		
		
		
		case 4:{
			final Swarchakra swarButton4 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0918", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
	        
	            	
			Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		 x= (int) ((int)pSceneTouchEvent.getX()-511);
          		 y=(int) ((int)pSceneTouchEvent.getY()-532);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
          		 preview("\u0918",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0; previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-511);
       		 y=(int) ((int)pSceneTouchEvent.getY()-532);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[4]==4){ 
        	    		
        	    	    activity.pos=activity.position[3];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[3]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[3],l);
        	    	
        	    	    setLetter( activity.position[3], l,block);
        	    	    
        	    	    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[3],c, block );
        			    activity.key[4]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key4");
        	    		
        	    		}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[51]==51){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[50];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[50]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[50],l);
        					
        			    setLetter( activity.position[50], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[50],c, block );
        			    activity.key[51]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[50]==50 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[49];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[49]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[49],l);
        					
        			    setLetter( activity.position[49], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[49],c, block );
        			    activity.key[50]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[54]==54 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[53];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[53]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[53],l);
        					
        			    setLetter( activity.position[53], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[53],c, block );
        			    activity.key[54]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[53]==53 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[52];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[52]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[52],l);
        					
        			    setLetter( activity.position[52], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[52],c, block );
        			    activity.key[53]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[52]==52){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[51];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[51]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[51],l);
        					
        			    setLetter( activity.position[51], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[51],c, block );
        			    activity.key[52]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[220]==220&& activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[219];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[219]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[219],l);
        					
        			    setLetter( activity.position[219], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[219],c, block );
        			    activity.key[220]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[221]==221 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[220];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[220]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[220],l);
        					
        			    setLetter( activity.position[220], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[220],c, block );
        			    activity.key[221]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[222]==222 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[221];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[221]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[221],l);
        					
        			    setLetter( activity.position[221], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[221],c, block );
        			    activity.key[222]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[223]==223 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[222];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[222]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[222],l);
        					
        			    setLetter( activity.position[222], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[222],c, block );
        			    activity.key[223]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[224]==224 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[223];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[223]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[223],l);
        					
        			    setLetter( activity.position[223], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[223],c, block );
        			    activity.key[224]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;
        			
        		}
        	}
	    	
	    	
	    	Flag=0;
	//        swarCFlag=0;
 
	        return true;
			
	        	}
	        	
	        		};
	        		 swarButton4.setPosition(354, 315 );
	        		 this.registerTouchArea(swarButton4);
	        		 this.attachChild(swarButton4);
	        		 
	        	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	        	 	 	
	        	        {                      
	        	            @Override
	        	            public void onTimePassed(final TimerHandler pTimerHandler)
	        	            {
	        	            	if(showFlag==0){
	        	            	unregisterTouchArea(swarButton4);
	        	            	detachChild(swarButton4);
	        	            	swarCFlag=0;
	        	            	showFlag=1;
	        	            	activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	        	            	}
	        	            }
	        	        })); 
	        	      }break;
			
		case 5:{
			final Swarchakra swarButton5 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0919", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
	        
	            	
        	Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-624);
          		 y=(int) ((int)pSceneTouchEvent.getY()-532);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0919",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0; previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-624);
       		 y=(int) ((int)pSceneTouchEvent.getY()-532);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[5]==5){ 
        	    		
        	    	    activity.pos=activity.position[4];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[4]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[4],l);
        					
            	   
        	    	    setLetter( activity.position[4], l,block);
        	    	    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[4],c, block );
        			    activity.key[5]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key5");
        	    		
        			    
        	    		}   break;
        			
        			
        			
        		case 1: 
        			if( activity.key[56]==56 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[55];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[55]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[55],l);
        					
        			    setLetter( activity.position[55], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[55],c, block );
        			    activity.key[56]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ki");
        			}break;
        			
        			

        			
        		case 2:
        			if( activity.key[55]==55){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[54];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[54]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[54],l);
        					
        			    setLetter( activity.position[54], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[54],c, block );
        			    activity.key[55]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kA");
        			}break;
        			
        		case 8:
        			if( activity.key[59]==59 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[58];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[58]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[58],l);
        					
        			    setLetter( activity.position[58], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[58],c, block );
        			    activity.key[59]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[58]==58 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[57];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[57]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[57],l);
        					
        			    setLetter( activity.position[57], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[57],c, block );
        			    activity.key[58]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ke");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[57]==57 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[56];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[56]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[56],l);
        					
        			    setLetter( activity.position[56], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[56],c, block );
        			    activity.key[57]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		case 3:
        			if( activity.key[225]==225&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[224];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[224]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[224],l);
        					
        			    setLetter( activity.position[224], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[224],c, block );
        			    activity.key[225]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[226]==226 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[225];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[225]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[225],l);
        					
        			    setLetter( activity.position[225], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[225],c, block );
        			    activity.key[226]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[227]==227 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[226];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[226]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[226],l);
        					
        			    setLetter( activity.position[226], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[226],c, block );
        			    activity.key[227]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[228]==228 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[227];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[227]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[227],l);
        					
        			    setLetter( activity.position[227], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[227],c, block );
        			    activity.key[228]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[229]==229 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[228];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[228]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[228],l);
        					
        			    setLetter( activity.position[228], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[228],c, block );
        			    activity.key[229]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;	
        		}
        	}

	    	Flag=0;
	   //     swarCFlag=0;


	        return true;
			
	        	}
	        	
	        		};
	        		 swarButton5.setPosition(471, 315 );
	        		 this.registerTouchArea(swarButton5);
	        		 this.attachChild(swarButton5);
	        		 
	        	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	        	 	 	
	        	        {                      
	        	            @Override
	        	            public void onTimePassed(final TimerHandler pTimerHandler)
	        	            {
	        	            	if(showFlag==0){
	        	            	unregisterTouchArea(swarButton5);
	        	            	detachChild(swarButton5);
	        	            	showFlag=1;
	        	            	swarCFlag=0;   
	        	            	activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	        	            	}
	        	            }
	        	        })); 
	        	      }break;
		
		case 6:{
			final Swarchakra swarButton6 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u091A", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
	            	
        	Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-172);
          		 y=(int) ((int)pSceneTouchEvent.getY()-618);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u091A",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-172);
       		 y=(int) ((int)pSceneTouchEvent.getY()-618);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[6]==6){ 
        	    		
        	    	    activity.pos=activity.position[5];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[5]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[5],l);
        	    	
        	    	    setLetter( activity.position[5], l,block);

        	    	    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[5],c, block );
        			    activity.key[6]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key6");
        	    		
        	    		}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[61]==61){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[60];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[60]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[60],l);
        					
        			    setLetter( activity.position[60], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[60],c, block );
        			    activity.key[61]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[60]==60){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[59];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[59]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[59],l);
        					
        			    setLetter( activity.position[59], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[59],c, block );
        			    activity.key[60]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[64]==64&& activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[63];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[63]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[63],l);
        					
        			    setLetter( activity.position[63], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[63],c, block );
        			    activity.key[64]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[63]==63&& activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[62];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[62]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[62],l);
        					
        			    setLetter( activity.position[62], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[62],c, block );
        			    activity.key[63]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[62]==62){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[61];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[61]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[61],l);
        					
        			    setLetter( activity.position[61], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[61],c, block );
        			    activity.key[62]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		case 3:
        			if( activity.key[230]==230&& activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[229];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[229]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[229],l);
        					
        			    setLetter( activity.position[229], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[229],c, block );
        			    activity.key[230]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[231]==231){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[230];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[230]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[230],l);
        					
        			    setLetter( activity.position[230], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[230],c, block );
        			    activity.key[231]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[232]==232){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[231];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[231]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[231],l);
        					
        			    setLetter( activity.position[231], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[231],c, block );
        			    activity.key[232]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[233]==233 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[232];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[232]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[232],l);
        					
        			    setLetter( activity.position[232], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[232],c, block );
        			    activity.key[233]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[234]==234 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[233];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[233]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[233],l);
        					
        			    setLetter( activity.position[233], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[233],c, block );
        			    activity.key[234]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;
        				
        		}
        	}
	    	
	    	Flag=0;


	        return true;
			
	        	}
	        	
	        		};
	        		 swarButton6.setPosition(3, 400 );
	        		 this.registerTouchArea(swarButton6);
	        		 this.attachChild(swarButton6);
	        		 
	        	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	        	 	 	
	        	        {                      
	        	            @Override
	        	            public void onTimePassed(final TimerHandler pTimerHandler)
	        	            {
	        	            	if(showFlag==0){
	        	            	unregisterTouchArea(swarButton6);
	        	            	detachChild(swarButton6);
	        	            	swarCFlag=0;    
	        	            	showFlag=1;
	        	            	activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	        	            }
	        	            }
	        	        })); 
	        	      }break;
		
		case 7:{
			final Swarchakra swarButton7 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u091B", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {
	        
	            	
			Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-285);
          		 y=(int) ((int)pSceneTouchEvent.getY()-618);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
           	
        		preview("\u091B",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-285);
       		 y=(int) ((int)pSceneTouchEvent.getY()-618);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[7]==7){ 
        	    		
        	    	    activity.pos=activity.position[6];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[6]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[6],l);

        	    	    setLetter( activity.position[6], l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[6],c, block );
        			    activity.key[7]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key7");
        	    		
        	    		}   break;
        			
        			
        			
        		case 1: 
        			if( activity.key[66]==66){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[65];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[65]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[65],l);
        					
        			    setLetter( activity.position[65], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[65],c, block );
        			    activity.key[66]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ki");
        			}break;
        			
        			

        			
        		case 2:
        			if( activity.key[65]==65){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[64];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[64]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[64],l);
        					
        			    setLetter( activity.position[64], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[64],c, block );
        			    activity.key[65]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kA");
        			}break;
        			
        		case 8:
        			if( activity.key[69]==69&& activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[68];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[68]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[68],l);
        					
        			    setLetter( activity.position[68], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[68],c, block );
        			    activity.key[69]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[68]==68&& activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[67];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[67]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[67],l);
        					
        			    setLetter( activity.position[67], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[67],c, block );
        			    activity.key[68]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ke");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[67]==67){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[66];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[66]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[66],l);
        					
        			    setLetter( activity.position[66], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[66],c, block );
        			    activity.key[67]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[235]==235&& activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[234];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[234]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[234],l);
        					
        			    setLetter( activity.position[234], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[234],c, block );
        			    activity.key[235]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[236]==236){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[235];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[235]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[225],l);
        					
        			    setLetter( activity.position[235], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[235],c, block );
        			    activity.key[236]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[237]==237){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[236];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[236]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[236],l);
        					
        			    setLetter( activity.position[236], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[236],c, block );
        			    activity.key[237]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[238]==238 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[237];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[237]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[237],l);
        					
        			    setLetter( activity.position[237], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[237],c, block );
        			    activity.key[238]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[239]==239 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[238];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[238]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[238],l);
        					
        			    setLetter( activity.position[238], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[238],c, block );
        			    activity.key[239]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;	
        				
        		}
        	}
	    	
	    		        Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton7.setPosition(120, 400 );
    		 this.registerTouchArea(swarButton7);
    		 this.attachChild(swarButton7);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton7);
    	            	detachChild(swarButton7);
    	            	showFlag=1;
    	            	swarCFlag=0;    
    	            	activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            }
    	            }
    	        })); 
    	      }break;

		
		case 8:{
			final Swarchakra swarButton8 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u091C", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	
        	Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-398);
          		 y=(int) ((int)pSceneTouchEvent.getY()-618);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u091C",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-398);
       		 y=(int) ((int)pSceneTouchEvent.getY()-618);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[8]==8){ 
        	    		
        	    	    activity.pos=activity.position[7];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[7]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[7],l);
        					
            	
        	    	    setLetter( activity.position[7], l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[7],c, block );
        			    activity.key[8]=0;
        			    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key8");
        	    		}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[71]==71){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[70];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[70]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[70],l);
        					
        			    setLetter( activity.position[70], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[70],c, block );
        			    activity.key[71]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[70]==70){
        				KeyFlag=1;	                        
                     	activity.pos=activity.position[69];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[69]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[69],l);
        					
        			    setLetter( activity.position[69], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[69],c, block );
        			    activity.key[70]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[74]==74&& activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[73];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[73]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[73],l);
        					
        			    setLetter( activity.position[73], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[73],c, block );
        			    activity.key[74]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[73]==73&& activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[72];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[72]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[72],l);
        					
        			    setLetter( activity.position[72], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[72],c, block );
        			    activity.key[73]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[72]==72){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[71];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[71]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[71],l);
        					
        			    setLetter( activity.position[71], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[71],c, block );
        			    activity.key[72]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[240]==240&& activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[239];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[239]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[239],l);
        					
        			    setLetter( activity.position[239], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[239],c, block );
        			    activity.key[240]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[241]==241){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[240];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[240]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[240],l);
        					
        			    setLetter( activity.position[240], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[240],c, block );
        			    activity.key[241]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[242]==242){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[241];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[241]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[241],l);
        					
        			    setLetter( activity.position[241], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[241],c, block );
        			    activity.key[242]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[243]==243 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[242];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[242]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[242],l);
        					
        			    setLetter( activity.position[242], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[242],c, block );
        			    activity.key[243]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[244]==244 && activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[243];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[243]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[243],l);
        					
        			    setLetter( activity.position[243], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[243],c, block );
        			    activity.key[244]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;	
        		}
        	}
	    	
	    	Flag=0;


	        return true;
			
    	}
    	
    		};
    		 swarButton8.setPosition(237, 400 );
    		 this.registerTouchArea(swarButton8);
    		 this.attachChild(swarButton8);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {   if(showFlag==0){
    	            	unregisterTouchArea(swarButton8);
    	            	detachChild(swarButton8);
    	            	 swarCFlag=0;
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            }
    	 	         }
    	        })); 
    	      }break;
		
		case 9:{
			final Swarchakra swarButton9 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u091D", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	
        	Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-511);
          		 y=(int) ((int)pSceneTouchEvent.getY()-618);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u091D",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-511);
       		 y=(int) ((int)pSceneTouchEvent.getY()-618);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[9]==9){ 
        	    		
        	    	    activity.pos=activity.position[8];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[8]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[8],l);
        					
           	
        	    	    setLetter( activity.position[8], l,block);

        	    	    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[8],c, block );
        			    activity.key[9]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key9");
        	    		
        	    		}break;
        			
        			
        			
        		case 1: 
        			if( activity.key[76]==76 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[75];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[75]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[75],l);
        					
        			    setLetter( activity.position[75], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[75],c, block );
        			    activity.key[76]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ki");
        			}break;
        			
        			

        			
        		case 2:
        			if( activity.key[75]==75 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[74];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[74]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[74],l);
        					
        			    setLetter( activity.position[74], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[74],c, block );
        			    activity.key[75]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kA");
        			}break;
        			
        		case 8:
        			if( activity.key[79]==79&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[78];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[78]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[78],l);
        					
        			    setLetter( activity.position[78], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[78],c, block );
        			    activity.key[79]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[78]==78&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[77];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[77]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[77],l);
        					
        			    setLetter( activity.position[77], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[77],c, block );
        			    activity.key[78]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ke");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[77]==77 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[76];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[76]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[76],l);
        					
        			    setLetter( activity.position[76], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[76],c, block );
        			    activity.key[77]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		case 3:
        			if( activity.key[245]==245 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[244];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[244]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[244],l);
        					
        			    setLetter( activity.position[244], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[244],c, block );
        			    activity.key[245]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[246]==246 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[245];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[245]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[245],l);
        					
        			    setLetter( activity.position[245], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[245],c, block );
        			    activity.key[246]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[247]==247 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[246];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[246]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[246],l);
        					
        			    setLetter( activity.position[246], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[246],c, block );
        			    activity.key[247]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[248]==248 && activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[247];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[247]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[247],l);
        					
        			    setLetter( activity.position[247], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[247],c, block );
        			    activity.key[248]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[249]==249&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[248];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[248]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[248],l);
        					
        			    setLetter( activity.position[248], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[248],c, block );
        			    activity.key[249]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;		
        		}
        	}
	    	
	    	
	    	     Flag=0;

	        return true;
			
	        	}
	        	
	        		};
	        		 swarButton9.setPosition(354, 400 );
	        		 this.registerTouchArea(swarButton9);
	        		 this.attachChild(swarButton9);
	        		 
	        	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	        	 	 	
	        	        {                      
	        	            @Override
	        	            public void onTimePassed(final TimerHandler pTimerHandler)
	        	            {
	        	            	if(showFlag==0){
	        	            	unregisterTouchArea(swarButton9);
	        	            	detachChild(swarButton9);
	        	            	 swarCFlag=0;
	        	            	 showFlag=1;
	        	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	        	            	}
	        	            }
	        	        })); 
	        	      }break;
		
		case 10:{
			final Swarchakra swarButton10 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u091E", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	
        	Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-624);
          		 y=(int) ((int)pSceneTouchEvent.getY()-618);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u091E",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-624);
       		 y=(int) ((int)pSceneTouchEvent.getY()-618);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[10]==10){ 
        	    		
        	    	    activity.pos=activity.position[9];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[9]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[9],l);
        					

        	    	    setLetter( activity.position[9], l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[9],c, block );
        			    activity.key[10]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key10");
        	    		
        	    		}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[81]==81 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[80];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[80]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[80],l);
        					
        			    setLetter( activity.position[80], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[80],c, block );
        			    activity.key[81]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[80]==80 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[79];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[79]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[79],l);
        					
        			    setLetter( activity.position[79], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[79],c, block );
        			    activity.key[80]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[84]==84 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[83];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[83]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[83],l);
        					
        			    setLetter( activity.position[83], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[83],c, block );
        			    activity.key[84]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[83]==83 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[82];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[82]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[82],l);
        					
        			    setLetter( activity.position[82], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[82],c, block );
        			    activity.key[83]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[82]==82 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[81];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[81]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[81],l);
        					
        			    setLetter( activity.position[81], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[81],c, block );
        			    activity.key[82]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[250]==250&& activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[249];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[249]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[249],l);
        					
        			    setLetter( activity.position[249], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[249],c, block );
        			    activity.key[250]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[251]==251){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[250];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[250]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[250],l);
        					
        			    setLetter( activity.position[250], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[250],c, block );
        			    activity.key[251]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[252]==252){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[251];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[251]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[251],l);
        					
        			    setLetter( activity.position[251], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[251],c, block );
        			    activity.key[252]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[253]==253 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[252];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[252]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[252],l);
        					
        			    setLetter( activity.position[252], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[252],c, block );
        			    activity.key[253]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[254]==254 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[253];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[253]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[253],l);
        					
        			    setLetter( activity.position[253], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[253],c, block );
        			    activity.key[254]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;		
        		}
        	}
	    	Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton10.setPosition(471, 400 );
    		 this.registerTouchArea(swarButton10);
    		 this.attachChild(swarButton10);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton10);
    	            	detachChild(swarButton10);
    	            	 swarCFlag=0;
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 
    	      }break;

		
		case 11:{
			final Swarchakra swarButton11 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u091F", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
			  Flag=1;
				 Blocks block;
				 int x=0,y=0;
		    		int radius=0,theta=0,theRegion;
		    		
		    		
		        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
		        	
		        		 x= (int) ((int)pSceneTouchEvent.getX()-172);
			       		 y=(int) ((int)pSceneTouchEvent.getY()-704);
			       		 radius = (int) Math.sqrt((x*x)+(y*y));
			       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
			       		 theRegion = findRegion(radius,theta);
		        		preview("\u091F",theRegion,this);
		        	}
		        	else
		        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
		        		showFlag=0;
		        		previewflag=0;
		        	 x= (int) ((int)pSceneTouchEvent.getX()-172);
		       		 y=(int) ((int)pSceneTouchEvent.getY()-704);
		       		 radius = (int) Math.sqrt((x*x)+(y*y));
		       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
		       		 theRegion = findRegion(radius,theta);
		        		
		            
		        		switch(theRegion){
		        		case 0:
		        			 if(activity.key[11]==11){ 
						    		
		      				   activity.pos=activity.position[10];
		      					block=new Blocks();
		      					block.sprite.setColor(activity.letterblock[activity.position[10]].sprite.getColor());
		      															
		      					Letter_Blocks l= new Letter_Blocks();
		      					color_match(activity.position[10],l);
		      															
		      										    	
		      					Color c= block.sprite.getColor();
		      						
		      					setLetter( activity.position[10], l,block);
		      					
		      					node(activity.position[10],c, block );
		      					activity.key[11]=0;
		      					
		      					nodeFlag=0;
		      				    Log.v("LEVEL","key11");
		      		    		
		      											    	    
		      				}break;
		        			
		        			
		        			
		        		case 1: 
		        			if( activity.key[86]==86 ){
		        				KeyFlag=1;	
		                        
		                     	activity.pos=activity.position[85];
		        		    	block=new Blocks();
		        			    block.sprite.setColor(activity.letterblock[activity.position[85]].sprite.getColor());
		        					
		        		        Letter_Blocks l= new Letter_Blocks();
		        			    color_match(activity.position[85],l);
		        					
		        			    setLetter( activity.position[85], l,block);
		        		    	
		        			    Color c= block.sprite.getColor();
		        			    
		        		    	node(activity.position[85],c, block );
		        			    activity.key[86]=0;
		        			    nodeFlag=0;
		        			    Log.v("LEVEL","ki");
		        			}break;
		        			
		        			

		        			
		        		case 2:
		        			if( activity.key[85]==85 ){
		        				KeyFlag=1;	
		                        
		                     	activity.pos=activity.position[84];
		        		    	block=new Blocks();
		        			    block.sprite.setColor(activity.letterblock[activity.position[84]].sprite.getColor());
		        					
		        		        Letter_Blocks l= new Letter_Blocks();
		        			    color_match(activity.position[84],l);
		        					
		        			    setLetter( activity.position[84], l,block);
		        		    	
		        			    Color c= block.sprite.getColor();
		        			    
		        		    	node(activity.position[84],c, block );
		        			    activity.key[85]=0;
		        			    nodeFlag=0;
		        			    Log.v("LEVEL","kA");
		        			}break;
		        			
		        		case 8:
		        			if( activity.key[89]==89 && activity.level!=3 ){
		        				KeyFlag=1;	
		                        
		                     	activity.pos=activity.position[88];
		        		    	block=new Blocks();
		        			    block.sprite.setColor(activity.letterblock[activity.position[88]].sprite.getColor());
		        					
		        		        Letter_Blocks l= new Letter_Blocks();
		        			    color_match(activity.position[88],l);
		        					
		        			    setLetter( activity.position[88], l,block);
		        		    	
		        			    Color c= block.sprite.getColor();
		        			    
		        		    	node(activity.position[88],c, block );
		        			    activity.key[89]=0;
		        			    nodeFlag=0;
		        			    Log.v("LEVEL","kAy");
		        			}break;
		        			
		        		case 9:
		        			if( activity.key[88]==88 && activity.level!=3){
		        				KeyFlag=1;	
		                        
		                     	activity.pos=activity.position[87];
		        		    	block=new Blocks();
		        			    block.sprite.setColor(activity.letterblock[activity.position[87]].sprite.getColor());
		        					
		        		        Letter_Blocks l= new Letter_Blocks();
		        			    color_match(activity.position[87],l);
		        					
		        			    setLetter( activity.position[87], l,block);
		        		    	
		        			    Color c= block.sprite.getColor();
		        			    
		        		    	node(activity.position[87],c, block );
		        			    activity.key[88]=0;
		        			    nodeFlag=0;
		        			    Log.v("LEVEL","ke");
		        			}break;
		        			
		        		case 10:
		        	
		        			if( activity.key[87]==87 ){
		        				KeyFlag=1;	
		                        
		                     	activity.pos=activity.position[86];
		        		    	block=new Blocks();
		        			    block.sprite.setColor(activity.letterblock[activity.position[86]].sprite.getColor());
		        					
		        		        Letter_Blocks l= new Letter_Blocks();
		        			    color_match(activity.position[86],l);
		        					
		        			    setLetter( activity.position[86], l,block);
		        		    	
		        			    Color c= block.sprite.getColor();
		        			    
		        		    	node(activity.position[86],c, block );
		        			    activity.key[87]=0;
		        			    nodeFlag=0;
		        			    Log.v("LEVEL","kii");
		        			}break;
		/*-------------------------------------------------------------------------------------------------------------------------*/
		        		
		        		case 3:
		        			if( activity.key[255]==255 && activity.level!=3 ){
		        				KeyFlag=1;	
		                        
		                     	activity.pos=activity.position[254];
		        		    	block=new Blocks();
		        			    block.sprite.setColor(activity.letterblock[activity.position[254]].sprite.getColor());
		        					
		        		        Letter_Blocks l= new Letter_Blocks();
		        			    color_match(activity.position[254],l);
		        					
		        			    setLetter( activity.position[254], l,block);
		        		    	
		        			    Color c= block.sprite.getColor();
		        			    
		        		    	node(activity.position[254],c, block );
		        			    activity.key[255]=0;
		        			    nodeFlag=0;
		        			    Log.v("LEVEL","halant");
		        			}break;
		        			
		        		case 4:
		        			if( activity.key[256]==256 ){
		        				KeyFlag=1;	
		                        
		                     	activity.pos=activity.position[255];
		        		    	block=new Blocks();
		        			    block.sprite.setColor(activity.letterblock[activity.position[255]].sprite.getColor());
		        					
		        		        Letter_Blocks l= new Letter_Blocks();
		        			    color_match(activity.position[255],l);
		        					
		        			    setLetter( activity.position[255], l,block);
		        		    	
		        			    Color c= block.sprite.getColor();
		        			    
		        		    	node(activity.position[255],c, block );
		        			    activity.key[256]=0;
		        			    nodeFlag=0;
		        			    Log.v("LEVEL","uu");
		        			}break;
		        			
		        		case 5:
		        			if( activity.key[257]==257 ){
		        				KeyFlag=1;	
		                        
		                     	activity.pos=activity.position[256];
		        		    	block=new Blocks();
		        			    block.sprite.setColor(activity.letterblock[activity.position[256]].sprite.getColor());
		        					
		        		        Letter_Blocks l= new Letter_Blocks();
		        			    color_match(activity.position[256],l);
		        					
		        			    setLetter( activity.position[256], l,block);
		        		    	
		        			    Color c= block.sprite.getColor();
		        			    
		        		    	node(activity.position[256],c, block );
		        			    activity.key[257]=0;
		        			    nodeFlag=0;
		        			    Log.v("LEVEL","u");
		        			}break;
		        			
		        		case 6:
		        			if( activity.key[258]==258 && activity.level!=3){
		        				KeyFlag=1;	
		                        
		                     	activity.pos=activity.position[257];
		        		    	block=new Blocks();
		        			    block.sprite.setColor(activity.letterblock[activity.position[257]].sprite.getColor());
		        					
		        		        Letter_Blocks l= new Letter_Blocks();
		        			    color_match(activity.position[257],l);
		        					
		        			    setLetter( activity.position[257], l,block);
		        		    	
		        			    Color c= block.sprite.getColor();
		        			    
		        		    	node(activity.position[257],c, block );
		        			    activity.key[258]=0;
		        			    nodeFlag=0;
		        			    Log.v("LEVEL","awe");
		        			}break;
		        			
		        		case 7:
		        			if( activity.key[259]==259 && activity.level!=3){
		        				KeyFlag=1;	
		                        
		                     	activity.pos=activity.position[258];
		        		    	block=new Blocks();
		        			    block.sprite.setColor(activity.letterblock[activity.position[258]].sprite.getColor());
		        					
		        		        Letter_Blocks l= new Letter_Blocks();
		        			    color_match(activity.position[258],l);
		        					
		        			    setLetter( activity.position[258], l,block);
		        		    	
		        			    Color c= block.sprite.getColor();
		        			    
		        		    	node(activity.position[258],c, block );
		        			    activity.key[259]=0;
		        			    nodeFlag=0;
		        			    Log.v("LEVEL","o");
		        			}break;
		        		}
		        	}
			    	
			  
			    Flag=0;
			    return true;
				
	        	}
	        	
	        		};
	        		 swarButton11.setPosition(3, 495 );
	        		 this.registerTouchArea(swarButton11);
	        		 this.attachChild(swarButton11);
	        		 
	        	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	        	 	 	
	        	        {                      
	        	            @Override
	        	            public void onTimePassed(final TimerHandler pTimerHandler)
	        	            {
	        	            	if(showFlag==0){
	        	            	unregisterTouchArea(swarButton11);
	        	            	detachChild(swarButton11);
	        	            	 swarCFlag=0;
	        	            	 showFlag=1;
	        	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	        	            }
	        	            }
	        	        })); 
	        	      }break;
		
		case 12:{
			final Swarchakra swarButton12 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0920", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	           	swarCFlag=1;
			Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-285);
          		 y=(int) ((int)pSceneTouchEvent.getY()-704);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0920",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-285);
       		 y=(int) ((int)pSceneTouchEvent.getY()-704);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[12]==12){ 
        	    		
        	    	    activity.pos=activity.position[11];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[11]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[11],l);
        					

        	    	    setLetter( activity.position[11], l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[11],c, block );
        			    activity.key[12]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key12");
        	    		
        	    		}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[91]==91 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[90];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[90]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[90],l);
        					
        			    setLetter( activity.position[90], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[90],c, block );
        			    activity.key[91]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[90]==90 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[89];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[89]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[89],l);
        					
        			    setLetter( activity.position[89], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[89],c, block );
        			    activity.key[90]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[94]==94 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[93];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[93]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[93],l);
        					
        			    setLetter( activity.position[93], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[93],c, block );
        			    activity.key[94]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[93]==93&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[92];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[92]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[92],l);
        					
        			    setLetter( activity.position[92], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[92],c, block );
        			    activity.key[93]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[92]==92 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[91];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[91]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[91],l);
        					
        			    setLetter( activity.position[91], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[91],c, block );
        			    activity.key[92]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[260]==260&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[259];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[259]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[259],l);
        					
        			    setLetter( activity.position[259], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[259],c, block );
        			    activity.key[260]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[261]==261 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[260];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[260]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[260],l);
        					
        			    setLetter( activity.position[260], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[260],c, block );
        			    activity.key[261]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[262]==262 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[261];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[261]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[261],l);
        					
        			    setLetter( activity.position[261], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[261],c, block );
        			    activity.key[262]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[263]==263 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[262];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[262]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[262],l);
        					
        			    setLetter( activity.position[262], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[262],c, block );
        			    activity.key[263]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[264]==264 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[263];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[263]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[263],l);
        					
        			    setLetter( activity.position[263], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[263],c, block );
        			    activity.key[264]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;			
        		}
        	}
	    	Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton12.setPosition(120, 495 );
    		 this.registerTouchArea(swarButton12);
    		 this.attachChild(swarButton12);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton12);
    	            	detachChild(swarButton12);
    	            	 swarCFlag=0;
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 
    	      }break;
		
		
		case 13:{
			final Swarchakra swarButton13 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0921", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
			Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-398);
          		 y=(int) ((int)pSceneTouchEvent.getY()-704);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0921",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-398);
       		 y=(int) ((int)pSceneTouchEvent.getY()-704);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[13]==13){ 
        	    		
        	    	    activity.pos=activity.position[12];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[12]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[12],l);
        					
        	    	
        	    	    setLetter( activity.position[12], l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[12],c, block );
        			    activity.key[13]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key13");
        	    		
        	    		}break;
        			
        			
        			
        		case 1: 
        			if( activity.key[96]==96 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[95];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[95]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[95],l);
        					
        			    setLetter( activity.position[95], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[95],c, block );
        			    activity.key[96]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ki");
        			}break;
        			
        			

        			
        		case 2:
        			if( activity.key[95]==95 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[94];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[94]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[94],l);
        					
        			    setLetter( activity.position[94], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[94],c, block );
        			    activity.key[95]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kA");
        			}break;
        			
        		case 8:
        			if( activity.key[99]==99 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[98];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[98]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[98],l);
        					
        			    setLetter( activity.position[98], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[98],c, block );
        			    activity.key[99]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[98]==98&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[97];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[97]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[97],l);
        					
        			    setLetter( activity.position[97], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[97],c, block );
        			    activity.key[98]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ke");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[97]==97 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[96];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[96]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[96],l);
        					
        			    setLetter( activity.position[96], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[96],c, block );
        			    activity.key[97]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[265]==265&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[264];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[264]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[264],l);
        					
        			    setLetter( activity.position[264], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[264],c, block );
        			    activity.key[265]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[266]==266 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[265];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[265]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[265],l);
        					
        			    setLetter( activity.position[265], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[265],c, block );
        			    activity.key[266]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[267]==267 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[266];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[266]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[266],l);
        					
        			    setLetter( activity.position[266], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[266],c, block );
        			    activity.key[267]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[268]==268 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[267];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[267]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[267],l);
        					
        			    setLetter( activity.position[267], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[267],c, block );
        			    activity.key[268]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[269]==269 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[268];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[268]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[268],l);
        					
        			    setLetter( activity.position[268], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[268],c, block );
        			    activity.key[269]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;	
        		}
        	}
	    	Flag=0;
	        return true;
			
	        	}
	        	
	        		};
	        		 swarButton13.setPosition(237, 495 );
	        		 this.registerTouchArea(swarButton13);
	        		 this.attachChild(swarButton13);
	        		 
	        	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	        	 	 	
	        	        {                      
	        	            @Override
	        	            public void onTimePassed(final TimerHandler pTimerHandler)
	        	            {
	        	            	if(showFlag==0){
	        	            	unregisterTouchArea(swarButton13);
	        	            	detachChild(swarButton13);
	        	            	 swarCFlag=0;
	        	            	 showFlag=1;
	        	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	        	            	}
	        	            }
	        	        })); 
	        	      }break;
		
		
		case 14:{
			final Swarchakra swarButton14 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0922", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
        	Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-511);
          		 y=(int) ((int)pSceneTouchEvent.getY()-704);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0922",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-511);
       		 y=(int) ((int)pSceneTouchEvent.getY()-704);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[14]==14){ 
        	    		
        	    	    activity.pos=activity.position[13];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[13]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[13],l);
        					
        	    	
        		    	Color c= block.sprite.getColor();

        		    	setLetter( activity.position[13], l,block);
        		    	
        		    	node(activity.position[13],c, block );
        			    activity.key[14]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key14");
        	    		
        	    		}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[101]==101 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[100];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[100]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[100],l);
        					
        			    setLetter( activity.position[100], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[100],c, block );
        			    activity.key[101]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[100]==100 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[99];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[99]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[99],l);
        					
        			    setLetter( activity.position[99], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[99],c, block );
        			    activity.key[100]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[104]==104&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[103];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[103]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[103],l);
        					
        			    setLetter( activity.position[103], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[103],c, block );
        			    activity.key[104]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[103]==103 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[102];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[102]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[102],l);
        					
        			    setLetter( activity.position[102], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[102],c, block );
        			    activity.key[103]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[102]==102 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[101];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[101]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[101],l);
        					
        			    setLetter( activity.position[101], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[101],c, block );
        			    activity.key[102]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[270]==270 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[269];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[269]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[269],l);
        					
        			    setLetter( activity.position[269], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[269],c, block );
        			    activity.key[270]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[271]==271 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[270];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[270]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[270],l);
        					
        			    setLetter( activity.position[270], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[270],c, block );
        			    activity.key[271]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[272]==272 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[271];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[271]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[271],l);
        					
        			    setLetter( activity.position[271], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[271],c, block );
        			    activity.key[272]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[273]==273 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[272];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[272]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[272],l);
        					
        			    setLetter( activity.position[272], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[272],c, block );
        			    activity.key[273]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[274]==274 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[273];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[273]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[273],l);
        					
        			    setLetter( activity.position[273], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[273],c, block );
        			    activity.key[274]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;
        			
        		}
        	}
	    	Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton14.setPosition(354, 495 );
    		 this.registerTouchArea(swarButton14);
    		 this.attachChild(swarButton14);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton14);
    	            	detachChild(swarButton14);
    	            	 swarCFlag=0;
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 
    	      }break;

	        
		
		
		case 15:{
			final Swarchakra swarButton15 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0923", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
			Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-624);
          		 y=(int) ((int)pSceneTouchEvent.getY()-704);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0923",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-624);
       		 y=(int) ((int)pSceneTouchEvent.getY()-704);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[15]==15){ 
        	    		
        	    	    activity.pos=activity.position[14];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[14]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[14],l);
        					
        	    	
        	    	    setLetter( activity.position[14], l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[14],c, block );
        			    activity.key[15]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key15");
        	    		
        	    		}break;
        			
        			
        			
        		case 1: 
        			if( activity.key[106]==106 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[105];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[105]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[105],l);
        					
        			    setLetter( activity.position[105], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[105],c, block );
        			    activity.key[106]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ki");
        			}break;
        			
        			

        			
        		case 2:
        			if( activity.key[105]==105 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[104];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[104]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[104],l);
        					
        			    setLetter( activity.position[104], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[104],c, block );
        			    activity.key[105]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kA");
        			}break;
        			
        		case 8:
        			if( activity.key[109]==109&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[108];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[108]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[108],l);
        					
        			    setLetter( activity.position[108], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[108],c, block );
        			    activity.key[109]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[108]==108 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[107];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[107]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[107],l);
        					
        			    setLetter( activity.position[107], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[107],c, block );
        			    activity.key[108]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ke");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[107]==107 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[106];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[106]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[106],l);
        					
        			    setLetter( activity.position[106], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[106],c, block );
        			    activity.key[107]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		case 3:
        			if( activity.key[275]==275&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[274];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[274]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[274],l);
        					
        			    setLetter( activity.position[274], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[274],c, block );
        			    activity.key[275]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[276]==276 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[275];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[275]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[275],l);
        					
        			    setLetter( activity.position[275], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[275],c, block );
        			    activity.key[276]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[277]==277 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[276];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[276]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[276],l);
        					
        			    setLetter( activity.position[276], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[276],c, block );
        			    activity.key[277]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[278]==278 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[277];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[277]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[277],l);
        					
        			    setLetter( activity.position[277], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[277],c, block );
        			    activity.key[278]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[279]==279 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[278];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[278]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[278],l);
        					
        			    setLetter( activity.position[278], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[278],c, block );
        			    activity.key[279]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;	
        		}
        	}
	    	
	    	 Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton15.setPosition(471, 495 );
    		 this.registerTouchArea(swarButton15);
    		 this.attachChild(swarButton15);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton15);
    	            	detachChild(swarButton15);
    	            	 swarCFlag=0;
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 
    	      }break;
		
		case 16:{
			final Swarchakra swarButton16 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0924", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
        	Flag=1;
	    	Blocks block;
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        		
        		x= (int) ((int)pSceneTouchEvent.getX()-172);
          		 y=(int) ((int)pSceneTouchEvent.getY()-790);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0924",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-172);
       		 y=(int) ((int)pSceneTouchEvent.getY()-790);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[16]==16){ 
        	    		
        	    	    activity.pos=activity.position[15];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[15]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[15],l);
        					
        	    
        	    	    setLetter( activity.position[15], l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[15],c, block );
        			    activity.key[16]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key16");
        	    		
        	    		}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[111]==111 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[110];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[110]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[110],l);
        					
        			    setLetter( activity.position[110], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[110],c, block );
        			    activity.key[111]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[110]==110 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[109];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[109]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[109],l);
        					
        			    setLetter( activity.position[109], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[109],c, block );
        			    activity.key[110]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[114]==114 && activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[113];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[113]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[113],l);
        					
        			    setLetter( activity.position[113], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[113],c, block );
        			    activity.key[114]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[113]==113 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[112];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[112]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[112],l);
        					
        			    setLetter( activity.position[112], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[112],c, block );
        			    activity.key[113]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[112]==112 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[111];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[111]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[111],l);
        					
        			    setLetter( activity.position[111], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[111],c, block );
        			    activity.key[112]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[280]==280 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[279];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[279]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[279],l);
        					
        			    setLetter( activity.position[279], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[279],c, block );
        			    activity.key[280]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[281]==281 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[280];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[280]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[280],l);
        					
        			    setLetter( activity.position[280], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[280],c, block );
        			    activity.key[281]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[282]==282 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[281];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[281]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[281],l);
        					
        			    setLetter( activity.position[281], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[281],c, block );
        			    activity.key[282]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[283]==283 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[282];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[282]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[282],l);
        					
        			    setLetter( activity.position[282], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[282],c, block );
        			    activity.key[283]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[284]==284 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[283];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[283]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[283],l);
        					
        			    setLetter( activity.position[283], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[283],c, block );
        			    activity.key[284]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;	
        		}
        	}
	    	Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton16.setPosition(3, 581 );
    		 this.registerTouchArea(swarButton16);
    		 this.attachChild(swarButton16);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton16);
    	            	detachChild(swarButton16);
    	            	 swarCFlag=0;   
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 
		}break;
			
		case 17:{
			final Swarchakra swarButton17 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0925", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
			Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-285);
          		 y=(int) ((int)pSceneTouchEvent.getY()-790);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0925",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-285);
       		 y=(int) ((int)pSceneTouchEvent.getY()-790);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[17]==17){ 
        	    		
        	    	    activity.pos=activity.position[16];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[16]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[16],l);
        					
        	    	    setLetter( activity.position[16], l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[16],c, block );
        			    activity.key[17]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key17");
        	    		
        	    		}break;
        			
        			
        			
        		case 1: 
        			if( activity.key[116]==116 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[115];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[115]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[115],l);
        					
        			    setLetter( activity.position[115], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[115],c, block );
        			    activity.key[116]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ki");
        			}break;
        			
        			

        			
        		case 2:
        			if( activity.key[115]==115 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[114];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[114]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[114],l);
        					
        			    setLetter( activity.position[114], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[114],c, block );
        			    activity.key[115]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kA");
        			}break;
        			
        		case 8:
        			if( activity.key[119]==119 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[118];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[118]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[118],l);
        					
        			    setLetter( activity.position[118], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[118],c, block );
        			    activity.key[119]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[118]==118 && activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[117];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[117]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[117],l);
        					
        			    setLetter( activity.position[117], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[117],c, block );
        			    activity.key[118]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ke");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[117]==117 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[116];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[116]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[116],l);
        					
        			    setLetter( activity.position[116], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[116],c, block );
        			    activity.key[117]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[285]==285 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[284];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[284]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[284],l);
        					
        			    setLetter( activity.position[284], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[284],c, block );
        			    activity.key[285]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[286]==286 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[285];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[285]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[285],l);
        					
        			    setLetter( activity.position[285], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[285],c, block );
        			    activity.key[286]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[287]==287 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[286];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[286]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[286],l);
        					
        			    setLetter( activity.position[286], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[286],c, block );
        			    activity.key[287]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[288]==288 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[287];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[287]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[287],l);
        					
        			    setLetter( activity.position[287], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[287],c, block );
        			    activity.key[288]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[289]==289 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[288];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[288]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[288],l);
        					
        			    setLetter( activity.position[288], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[288],c, block );
        			    activity.key[289]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;		
        		}
        	}
	        Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton17.setPosition(120, 581 );
    		 this.registerTouchArea(swarButton17);
    		 this.attachChild(swarButton17);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton17);
    	            	detachChild(swarButton17);
    	            	 swarCFlag=0;
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 
    	      }break;
		
		case 18:{
			final Swarchakra swarButton18 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0926", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
			Flag=1;
	    	Blocks block;
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-398);
          		 y=(int) ((int)pSceneTouchEvent.getY()-790);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0926",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-398);
       		 y=(int) ((int)pSceneTouchEvent.getY()-790);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[18]==18){ 
        	    		
        	    	    activity.pos=activity.position[17];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[17]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[17],l);
        					

        	    	    setLetter( activity.position[17], l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[17],c, block );
        			    activity.key[18]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key18");
        	    		
        	    		}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[121]==121 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[120];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[120]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[120],l);
        					
        			    setLetter( activity.position[120], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[120],c, block );
        			    activity.key[121]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[120]==120 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[119];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[119]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[119],l);
        					
        			    setLetter( activity.position[119], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[119],c, block );
        			    activity.key[120]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[124]==124&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[123];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[123]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[123],l);
        					
        			    setLetter( activity.position[123], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[123],c, block );
        			    activity.key[124]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[123]==123&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[122];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[122]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[122],l);
        					
        			    setLetter( activity.position[122], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[122],c, block );
        			    activity.key[123]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[122]==122 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[121];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[121]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[121],l);
        					
        			    setLetter( activity.position[121], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[121],c, block );
        			    activity.key[122]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[290]==290 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[289];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[289]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[289],l);
        					
        			    setLetter( activity.position[289], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[289],c, block );
        			    activity.key[290]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[291]==291 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[290];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[290]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[290],l);
        					
        			    setLetter( activity.position[290], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[290],c, block );
        			    activity.key[291]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[292]==292 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[291];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[291]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[291],l);
        					
        			    setLetter( activity.position[291], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[291],c, block );
        			    activity.key[292]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[293]==293 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[292];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[292]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[292],l);
        					
        			    setLetter( activity.position[292], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[292],c, block );
        			    activity.key[293]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[294]==294 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[293];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[293]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[293],l);
        					
        			    setLetter( activity.position[293], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[293],c, block );
        			    activity.key[294]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;	
        		}
        	}
	    	Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton18.setPosition(237, 581 );
    		 this.registerTouchArea(swarButton18);
    		 this.attachChild(swarButton18);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton18);
    	            	detachChild(swarButton18);
    	            	 swarCFlag=0; 
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 
    	      }break;
		
		case 19:{
			final Swarchakra swarButton19 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0927", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
        	Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		 x= (int) ((int)pSceneTouchEvent.getX()-511);
          		 y=(int) ((int)pSceneTouchEvent.getY()-790);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
          		 preview("\u0927",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-511);
       		 y=(int) ((int)pSceneTouchEvent.getY()-790);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[19]==19){ 
        	    		
        	    	    activity.pos=activity.position[18];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[18]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[18],l);
        			

        	    	    setLetter( activity.position[18], l,block);
        	    	    
        	    	    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[18],c, block );
        			    activity.key[19]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key19");
        	    		
        	    		}break;
        			
        			
        			
        		case 1: 
        			if( activity.key[126]==126 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[125];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[125]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[125],l);
        					
        			    setLetter( activity.position[125], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[125],c, block );
        			    activity.key[126]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ki");
        			}break;
        			
        			

        			
        		case 2:
        			if( activity.key[125]==125 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[124];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[124]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[124],l);
        					
        			    setLetter( activity.position[124], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[124],c, block );
        			    activity.key[125]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kA");
        			}break;
        			
        		case 8:
        			if( activity.key[129]==129 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[128];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[128]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[128],l);
        					
        			    setLetter( activity.position[128], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[128],c, block );
        			    activity.key[129]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[128]==128&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[127];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[127]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[127],l);
        					
        			    setLetter( activity.position[127], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[127],c, block );
        			    activity.key[128]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ke");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[127]==127 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[126];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[126]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[126],l);
        					
        			    setLetter( activity.position[126], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[126],c, block );
        			    activity.key[127]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[295]==295&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[294];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[294]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[294],l);
        					
        			    setLetter( activity.position[294], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[294],c, block );
        			    activity.key[295]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[296]==296 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[295];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[295]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[295],l);
        					
        			    setLetter( activity.position[295], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[295],c, block );
        			    activity.key[296]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[297]==297 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[296];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[296]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[296],l);
        					
        			    setLetter( activity.position[296], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[296],c, block );
        			    activity.key[297]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[298]==298 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[297];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[297]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[297],l);
        					
        			    setLetter( activity.position[297], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[297],c, block );
        			    activity.key[298]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[299]==299 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[298];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[298]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[298],l);
        					
        			    setLetter( activity.position[298], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[298],c, block );
        			    activity.key[299]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;
        			
        		}
        	}
	    	Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton19.setPosition(354, 581 );
    		 this.registerTouchArea(swarButton19);
    		 this.attachChild(swarButton19);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton19);
    	            	detachChild(swarButton19);
    	            	 swarCFlag=0;   
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 
    	      }break;	
    	        
    	        
		case 20:{
			final Swarchakra swarButton20 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0928", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
        	Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-624);
          		 y=(int) ((int)pSceneTouchEvent.getY()-790);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0928",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-624);
       		 y=(int) ((int)pSceneTouchEvent.getY()-790);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[20]==20){ 
        	    		
        	    	    activity.pos=activity.position[19];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[19]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[19],l);
        					
        		    
        	    	    setLetter( activity.position[19], l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[19],c, block );
        			    activity.key[20]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key20");
        	    		
        	    		}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[131]==131 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[130];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[130]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[130],l);
        					
        			    setLetter( activity.position[130], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[130],c, block );
        			    activity.key[131]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[130]==130 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[129];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[129]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[129],l);
        					
        			    setLetter( activity.position[129], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[129],c, block );
        			    activity.key[130]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[134]==134&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[133];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[133]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[133],l);
        					
        			    setLetter( activity.position[133], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[133],c, block );
        			    activity.key[134]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[133]==133 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[132];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[132]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[132],l);
        					
        			    setLetter( activity.position[132], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[132],c, block );
        			    activity.key[133]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[132]==132 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[131];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[131]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[131],l);
        					
        			    setLetter( activity.position[131], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[131],c, block );
        			    activity.key[132]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[300]==300 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[299];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[299]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[299],l);
        					
        			    setLetter( activity.position[299], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[299],c, block );
        			    activity.key[300]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[301]==301 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[300];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[300]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[300],l);
        					
        			    setLetter( activity.position[300], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[300],c, block );
        			    activity.key[301]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[302]==302 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[301];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[301]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[301],l);
        					
        			    setLetter( activity.position[301], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[301],c, block );
        			    activity.key[302]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[303]==303 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[302];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[302]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[302],l);
        					
        			    setLetter( activity.position[302], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[302],c, block );
        			    activity.key[303]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[304]==304 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[303];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[303]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[303],l);
        					
        			    setLetter( activity.position[303], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[303],c, block );
        			    activity.key[304]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;		
        		}
        	}
	    	Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton20.setPosition(471, 581 );
    		 this.registerTouchArea(swarButton20);
    		 this.attachChild(swarButton20);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton20);
    	            	detachChild(swarButton20);
    	            	 swarCFlag=0; 
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 
    	      }break;		
		
		case 21:{
			final Swarchakra swarButton21 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u092A", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
            Flag=1;
			 Blocks block;
			 
			 int x=0,y=0;
	    		int radius=0,theta=0,theRegion;
	    		
	    		
	        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
	        	
	        		x= (int) ((int)pSceneTouchEvent.getX()-172);
		       		 y=(int) ((int)pSceneTouchEvent.getY()-876);
		       		 radius = (int) Math.sqrt((x*x)+(y*y));
		       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
		       		 theRegion = findRegion(radius,theta);
	        		preview("\u092A",theRegion,this);
	        	}
	        	else
	        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
	        		showFlag=0;
	        		previewflag=0;
	        	 x= (int) ((int)pSceneTouchEvent.getX()-172);
	       		 y=(int) ((int)pSceneTouchEvent.getY()-876);
	       		 radius = (int) Math.sqrt((x*x)+(y*y));
	       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
	       		 theRegion = findRegion(radius,theta);
	        		
	            
	        		switch(theRegion){
	        		case 0:
	        			if(activity.key[21]==21){ 
				    		
	        				   activity.pos=activity.position[20];
	        					block=new Blocks();
	        					block.sprite.setColor(activity.letterblock[activity.position[20]].sprite.getColor());
	        															
	        					Letter_Blocks l= new Letter_Blocks();
	        					color_match(activity.position[20],l);
	        															
	        						
	        					setLetter( activity.position[20], l,block);
	        					
	        					Color c= block.sprite.getColor();
	        													    
	        					node(activity.position[20],c, block );
	        					activity.key[21]=0;
	        					
	        					nodeFlag=0;
	        				    Log.v("LEVEL","key21");
	        		    		
	        				 }break;
	        			
	        			
	        			
	        		case 1: 
	        			if( activity.key[136]==136 ){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[135];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[135]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[135],l);
	        					
	        			    setLetter( activity.position[135], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[135],c, block );
	        			    activity.key[136]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","ki");
	        			}break;
	        			
	        			

	        			
	        		case 2:
	        			if( activity.key[135]==135 ){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[134];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[134]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[134],l);
	        					
	        			    setLetter( activity.position[134], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[134],c, block );
	        			    activity.key[135]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","kA");
	        			}break;
	        			
	        		case 8:
	        			if( activity.key[139]==139&& activity.level!=3 ){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[138];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[138]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[138],l);
	        					
	        			    setLetter( activity.position[138], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[138],c, block );
	        			    activity.key[139]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","kAy");
	        			}break;
	        			
	        		case 9:
	        			if( activity.key[138]==138&& activity.level!=3 ){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[137];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[137]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[137],l);
	        					
	        			    setLetter( activity.position[137], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[137],c, block );
	        			    activity.key[138]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","ke");
	        			}break;
	        			
	        		case 10:
	        	
	        			if( activity.key[137]==137 ){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[136];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[136]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[136],l);
	        					
	        			    setLetter( activity.position[136], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[136],c, block );
	        			    activity.key[137]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","kii");
	        			}break;
	/*-------------------------------------------------------------------------------------------------------------------------*/
	        		case 3:
	        			if( activity.key[305]==305&& activity.level!=3 ){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[304];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[304]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[304],l);
	        					
	        			    setLetter( activity.position[304], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[304],c, block );
	        			    activity.key[305]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","halant");
	        			}break;
	        			
	        		case 4:
	        			if( activity.key[306]==306 ){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[305];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[305]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[305],l);
	        					
	        			    setLetter( activity.position[305], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[305],c, block );
	        			    activity.key[306]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","uu");
	        			}break;
	        			
	        		case 5:
	        			if( activity.key[307]==307 ){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[306];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[306]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[306],l);
	        					
	        			    setLetter( activity.position[306], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[306],c, block );
	        			    activity.key[307]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","u");
	        			}break;
	        			
	        		case 6:
	        			if( activity.key[308]==308 && activity.level!=3){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[307];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[307]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[307],l);
	        					
	        			    setLetter( activity.position[307], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[307],c, block );
	        			    activity.key[308]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","awe");
	        			}break;
	        			
	        		case 7:
	        			if( activity.key[309]==309 && activity.level!=3){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[308];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[308]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[308],l);
	        					
	        			    setLetter( activity.position[308], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[308],c, block );
	        			    activity.key[309]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","o");
	        			}break;	
	        		}
	        	}
			 
             
		    Flag=0;
		    return true;
			
	        	}
	        	
	        		};
	        		 swarButton21.setPosition(3, 667 );
	        		 this.registerTouchArea(swarButton21);
	        		 this.attachChild(swarButton21);
	        		 
	        	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	        	 	 	
	        	        {                      
	        	            @Override
	        	            public void onTimePassed(final TimerHandler pTimerHandler)
	        	            {
	        	            	if(showFlag==0){
	        	            	unregisterTouchArea(swarButton21);
	        	            	detachChild(swarButton21);
	        	            	 swarCFlag=0;   
	        	            	 showFlag=1;
	        	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	        	            	}
	        	            }
	        	        })); 
		}break;	
		
		case 22:{
			final Swarchakra swarButton22 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u092B", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
        	Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-285);
          		 y=(int) ((int)pSceneTouchEvent.getY()-876);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u092B",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-285);
       		 y=(int) ((int)pSceneTouchEvent.getY()-876);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[22]==22){ 
        	    		
        	    	    activity.pos=activity.position[21];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[21]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[21],l);
        					

        	    	    setLetter( activity.position[21], l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[21],c, block );
        			    activity.key[22]=0;
        	    	 
        			    nodeFlag=0;
        			    Log.v("LEVEL","key22");
        			    
        	    		}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[141]==141 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[140];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[140]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[140],l);
        					
        			    setLetter( activity.position[140], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[140],c, block );
        			    activity.key[141]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[140]==140 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[139];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[139]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[139],l);
        					
        			    setLetter( activity.position[139], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[139],c, block );
        			    activity.key[140]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[144]==144 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[143];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[143]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[143],l);
        					
        			    setLetter( activity.position[143], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[143],c, block );
        			    activity.key[144]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[143]==143&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[142];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[142]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[142],l);
        					
        			    setLetter( activity.position[142], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[142],c, block );
        			    activity.key[143]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[142]==142 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[141];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[141]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[141],l);
        					
        			    setLetter( activity.position[141], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[141],c, block );
        			    activity.key[142]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[310]==310&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[309];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[309]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[309],l);
        					
        			    setLetter( activity.position[309], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[309],c, block );
        			    activity.key[310]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[311]==311 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[310];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[310]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[310],l);
        					
        			    setLetter( activity.position[310], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[310],c, block );
        			    activity.key[311]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[312]==312 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[311];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[311]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[311],l);
        					
        			    setLetter( activity.position[311], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[311],c, block );
        			    activity.key[312]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[313]==313 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[312];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[312]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[312],l);
        					
        			    setLetter( activity.position[312], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[312],c, block );
        			    activity.key[313]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[314]==314 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[313];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[313]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[313],l);
        					
        			    setLetter( activity.position[313], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[313],c, block );
        			    activity.key[314]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;		
        				
        		}
        	}
	    	
	    	    Flag=0;

  return true;
			
    	}
    	
    		};
    		 swarButton22.setPosition(120, 667 );
    		 this.registerTouchArea(swarButton22);
    		 this.attachChild(swarButton22);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton22);
    	            	detachChild(swarButton22);
    	            	 swarCFlag=0; 
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 
		}break;	
		
		case 23:{
			final Swarchakra swarButton23 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u092C", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
        	Flag=1;
	    	Blocks block;
	    	
	    	 int x=0,y=0;
	    		int radius=0,theta=0,theRegion;
	    		
	    		
	        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
	        	
	        		x= (int) ((int)pSceneTouchEvent.getX()-398);
		       		 y=(int) ((int)pSceneTouchEvent.getY()-876);
		       		 radius = (int) Math.sqrt((x*x)+(y*y));
		       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
		       		 theRegion = findRegion(radius,theta);
	        		preview("\u092C",theRegion,this);
	        	}
	        	else
	        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
	        		showFlag=0;
	        		previewflag=0;
	        	 x= (int) ((int)pSceneTouchEvent.getX()-398);
	       		 y=(int) ((int)pSceneTouchEvent.getY()-876);
	       		 radius = (int) Math.sqrt((x*x)+(y*y));
	       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
	       		 theRegion = findRegion(radius,theta);
	        		
	            
	        		switch(theRegion){
	        		case 0:
	        			if(activity.key[23]==23){ 
	        	    		
	        	    	    activity.pos=activity.position[22];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[22]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[22],l);
	        				
	        		    	Color c= block.sprite.getColor();

	        		    	setLetter( activity.position[22], l,block);
	        		    	
	        		    	node(activity.position[22],c, block );
	        			    activity.key[23]=0;
	        	    	    
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","key23");
	        	    		}break;
	        			
	        			
	        			
	        		case 1: 
	        			if( activity.key[146]==146 ){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[145];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[145]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[145],l);
	        					
	        			    setLetter( activity.position[145], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[145],c, block );
	        			    activity.key[146]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","ki");
	        			}break;
	        			
	        			

	        			
	        		case 2:
	        			if( activity.key[145]==145 ){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[144];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[144]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[144],l);
	        					
	        			    setLetter( activity.position[144], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[144],c, block );
	        			    activity.key[145]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","kA");
	        			}break;
	        			
	        		case 8:
	        			if( activity.key[149]==149 && activity.level!=3){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[148];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[148]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[148],l);
	        					
	        			    setLetter( activity.position[148], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[148],c, block );
	        			    activity.key[149]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","kAy");
	        			}break;
	        			
	        		case 9:
	        			if( activity.key[148]==148&& activity.level!=3 ){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[147];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[147]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[147],l);
	        					
	        			    setLetter( activity.position[147], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[147],c, block );
	        			    activity.key[148]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","ke");
	        			}break;
	        			
	        		case 10:
	        	
	        			if( activity.key[147]==147 ){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[146];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[146]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[146],l);
	        					
	        			    setLetter( activity.position[146], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[146],c, block );
	        			    activity.key[147]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","kii");
	        			}break;
	/*-------------------------------------------------------------------------------------------------------------------------*/
	        		
	        		case 3:
	        			if( activity.key[315]==315&& activity.level!=3 ){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[314];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[314]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[314],l);
	        					
	        			    setLetter( activity.position[314], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[314],c, block );
	        			    activity.key[315]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","halant");
	        			}break;
	        			
	        		case 4:
	        			if( activity.key[316]==316 ){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[315];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[315]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[315],l);
	        					
	        			    setLetter( activity.position[315], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[315],c, block );
	        			    activity.key[316]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","uu");
	        			}break;
	        			
	        		case 5:
	        			if( activity.key[317]==317 ){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[316];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[316]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[316],l);
	        					
	        			    setLetter( activity.position[316], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[316],c, block );
	        			    activity.key[317]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","u");
	        			}break;
	        			
	        		case 6:
	        			if( activity.key[318]==318 && activity.level!=3){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[317];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[317]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[317],l);
	        					
	        			    setLetter( activity.position[317], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[317],c, block );
	        			    activity.key[318]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","awe");
	        			}break;
	        			
	        		case 7:
	        			if( activity.key[319]==319 && activity.level!=3){
	        				KeyFlag=1;	
	                        
	                     	activity.pos=activity.position[318];
	        		    	block=new Blocks();
	        			    block.sprite.setColor(activity.letterblock[activity.position[318]].sprite.getColor());
	        					
	        		        Letter_Blocks l= new Letter_Blocks();
	        			    color_match(activity.position[318],l);
	        					
	        			    setLetter( activity.position[318], l,block);
	        		    	
	        			    Color c= block.sprite.getColor();
	        			    
	        		    	node(activity.position[318],c, block );
	        			    activity.key[319]=0;
	        			    nodeFlag=0;
	        			    Log.v("LEVEL","o");
	        			}break;	
	        		}
	        	}
	    	Flag=0;
	        return true;
			
	        	}
	        	
	        		};
	        		 swarButton23.setPosition(237, 667 );
	        		 this.registerTouchArea(swarButton23);
	        		 this.attachChild(swarButton23);
	        		 
	        	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	        	 	 	
	        	        {                      
	        	            @Override
	        	            public void onTimePassed(final TimerHandler pTimerHandler)
	        	            {
	        	            	if(showFlag==0){
	        	            	unregisterTouchArea(swarButton23);
	        	            	detachChild(swarButton23);
	        	            	 swarCFlag=0;
	        	            	 showFlag=1;
	        	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	        	            	}
	        	            }	        	            
	        	        })); 

		}break;
		
		case 24:{
			final Swarchakra swarButton24 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u092D", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
        	Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-511);
          		 y=(int) ((int)pSceneTouchEvent.getY()-876);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u092D",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-511);
       		 y=(int) ((int)pSceneTouchEvent.getY()-876);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[24]==24){ 
        	    		
        	    	    activity.pos=activity.position[23];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[23]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[23],l);
        					
        	    	    setLetter( activity.position[23], l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[23],c, block );
        			    activity.key[24]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key24");
        	    		}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[151]==151 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[150];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[150]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[150],l);
        					
        			    setLetter( activity.position[150], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[150],c, block );
        			    activity.key[151]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[150]==150 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[149];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[149]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[149],l);
        					
        			    setLetter( activity.position[149], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[149],c, block );
        			    activity.key[150]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[154]==154 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[153];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[153]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[153],l);
        					
        			    setLetter( activity.position[153], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[153],c, block );
        			    activity.key[154]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[153]==153 && activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[152];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[152]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[152],l);
        					
        			    setLetter( activity.position[152], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[152],c, block );
        			    activity.key[153]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[152]==152 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[151];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[151]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[151],l);
        					
        			    setLetter( activity.position[151], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[151],c, block );
        			    activity.key[152]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[320]==320 && activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[319];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[319]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[319],l);
        					
        			    setLetter( activity.position[319], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[319],c, block );
        			    activity.key[320]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[321]==321 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[320];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[320]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[320],l);
        					
        			    setLetter( activity.position[320], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[320],c, block );
        			    activity.key[321]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[322]==322 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[321];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[321]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[321],l);
        					
        			    setLetter( activity.position[321], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[321],c, block );
        			    activity.key[322]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[323]==323 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[322];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[322]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[322],l);
        					
        			    setLetter( activity.position[322], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[322],c, block );
        			    activity.key[323]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[324]==324 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[323];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[323]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[323],l);
        					
        			    setLetter( activity.position[323], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[323],c, block );
        			    activity.key[324]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;		
        		}
        	}
	    	
	    	Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton24.setPosition(354, 667 );
    		 this.registerTouchArea(swarButton24);
    		 this.attachChild(swarButton24);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton24);
    	            	detachChild(swarButton24);
    	            	 swarCFlag=0;   
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 
		}break;
		
		case 25:{
			final Swarchakra swarButton25 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u092E", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
        	Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-624);
          		 y=(int) ((int)pSceneTouchEvent.getY()-876);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u092E",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-624);
       		 y=(int) ((int)pSceneTouchEvent.getY()-876);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[25]==25){ 
        	    		
        	    	    activity.pos=activity.position[24];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[24]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[24],l);
        					
        	    	
        	    	    setLetter( activity.position[24], l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[24],c, block );
        			    activity.key[25]=0;
        			    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key25");
        	    	    
        	    		}break;
        			
        			
        			
        		case 1: 
        			if( activity.key[156]==156 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[155];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[155]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[155],l);
        					
        			    setLetter( activity.position[155], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[155],c, block );
        			    activity.key[156]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ki");
        			}break;
        			
        			

        			
        		case 2:
        			if( activity.key[155]==155 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[154];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[154]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[154],l);
        					
        			    setLetter( activity.position[154], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[154],c, block );
        			    activity.key[155]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kA");
        			}break;
        			
        		case 8:
        			if( activity.key[159]==159 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[158];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[158]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[158],l);
        					
        			    setLetter( activity.position[158], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[158],c, block );
        			    activity.key[159]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[158]==158 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[157];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[157]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[157],l);
        					
        			    setLetter( activity.position[157], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[157],c, block );
        			    activity.key[158]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ke");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[157]==157 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[156];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[156]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[156],l);
        					
        			    setLetter( activity.position[156], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[156],c, block );
        			    activity.key[157]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[325]==325&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[324];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[324]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[324],l);
        					
        			    setLetter( activity.position[324], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[324],c, block );
        			    activity.key[325]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[326]==326 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[325];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[325]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[325],l);
        					
        			    setLetter( activity.position[325], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[325],c, block );
        			    activity.key[326]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[327]==327 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[326];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[326]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[326],l);
        					
        			    setLetter( activity.position[326], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[326],c, block );
        			    activity.key[327]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[328]==328 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[327];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[327]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[327],l);
        					
        			    setLetter( activity.position[327], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[327],c, block );
        			    activity.key[328]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[329]==329 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[328];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[328]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[328],l);
        					
        			    setLetter( activity.position[328], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[328],c, block );
        			    activity.key[329]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;		
        		}
        	}
	    	Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton25.setPosition(471, 667 );
    		 this.registerTouchArea(swarButton25);
    		 this.attachChild(swarButton25);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton25);
    	            	detachChild(swarButton25);
    	            	 swarCFlag=0;    
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 

		}break;
		
		case 26:{
			final Swarchakra swarButton26 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u092F", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
        	Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-172);
          		 y=(int) ((int)pSceneTouchEvent.getY()-962);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u092F",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-172);
       		 y=(int) ((int)pSceneTouchEvent.getY()-962);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[26]==26){ 
        	    		
        	    	    activity.pos=activity.position[25];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[25]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[25],l);
        					
        	    	
        	    	    setLetter(activity.position[25],l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[25],c, block );
        			    activity.key[26]=0;
        			    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key26");
        	    	    
        	    		}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[161]==161 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[160];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[160]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[160],l);
        					
        			    setLetter( activity.position[160], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[160],c, block );
        			    activity.key[161]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[160]==160 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[159];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[159]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[159],l);
        					
        			    setLetter( activity.position[159], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[159],c, block );
        			    activity.key[160]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[164]==164 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[163];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[163]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[163],l);
        					
        			    setLetter( activity.position[163], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[163],c, block );
        			    activity.key[164]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[163]==163 && activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[162];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[162]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[162],l);
        					
        			    setLetter( activity.position[162], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[162],c, block );
        			    activity.key[163]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[162]==162 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[161];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[161]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[161],l);
        					
        			    setLetter( activity.position[161], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[161],c, block );
        			    activity.key[162]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[330]==330 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[329];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[329]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[329],l);
        					
        			    setLetter( activity.position[329], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[329],c, block );
        			    activity.key[330]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[331]==331 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[330];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[330]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[330],l);
        					
        			    setLetter( activity.position[330], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[330],c, block );
        			    activity.key[331]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[332]==332 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[331];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[331]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[331],l);
        					
        			    setLetter( activity.position[331], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[331],c, block );
        			    activity.key[332]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[333]==333 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[332];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[332]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[332],l);
        					
        			    setLetter( activity.position[332], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[332],c, block );
        			    activity.key[333]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[334]==334 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[333];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[333]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[333],l);
        					
        			    setLetter( activity.position[333], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[333],c, block );
        			    activity.key[334]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;		
        		}
        	}
	    	
	    	Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton26.setPosition(3, 753 );
    		 this.registerTouchArea(swarButton26);
    		 this.attachChild(swarButton26);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton26);
    	            	detachChild(swarButton26);
    	            	 swarCFlag=0;   
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 
		}break;
		
		case 27:{
			final Swarchakra swarButton27 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0930", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
        	Flag=1;
	    	Blocks block;
	    	

	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-285);
          		 y=(int) ((int)pSceneTouchEvent.getY()-962);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0930",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-285);
       		 y=(int) ((int)pSceneTouchEvent.getY()-962);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[27]==27){ 
        	    		
        	    	    activity.pos=activity.position[26];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[26]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[26],l);
        					
            	
        	    	    setLetter(activity.position[26],l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[26],c, block );
        			    activity.key[27]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key27");
        	    		}break;
        			
        			
        			
        		case 1: 
        			if( activity.key[166]==166 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[165];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[165]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[165],l);
        					
        			    setLetter( activity.position[165], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[165],c, block );
        			    activity.key[166]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ki");
        			}break;
        			
        			

        			
        		case 2:
        			if( activity.key[165]==165 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[164];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[164]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[164],l);
        					
        			    setLetter( activity.position[164], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[164],c, block );
        			    activity.key[165]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kA");
        			}break;
        			
        		case 8:
        			if( activity.key[169]==169 && activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[168];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[168]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[168],l);
        					
        			    setLetter( activity.position[168], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[168],c, block );
        			    activity.key[169]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[168]==168 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[167];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[167]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[167],l);
        					
        			    setLetter( activity.position[167], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[167],c, block );
        			    activity.key[168]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ke");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[167]==167 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[166];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[166]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[166],l);
        					
        			    setLetter( activity.position[166], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[166],c, block );
        			    activity.key[167]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[335]==335&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[334];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[334]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[334],l);
        					
        			    setLetter( activity.position[334], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[334],c, block );
        			    activity.key[335]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[336]==336 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[335];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[335]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[335],l);
        					
        			    setLetter( activity.position[335], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[335],c, block );
        			    activity.key[336]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[337]==337 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[336];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[336]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[336],l);
        					
        			    setLetter( activity.position[336], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[336],c, block );
        			    activity.key[337]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[338]==338 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[337];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[337]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[337],l);
        					
        			    setLetter( activity.position[337], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[337],c, block );
        			    activity.key[338]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[339]==339 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[338];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[338]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[338],l);
        					
        			    setLetter( activity.position[338], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[338],c, block );
        			    activity.key[339]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;	
        		}
        	}
	    	
	    	    
	        Flag=0;
	        return true;
			
	        	}
	        	
	        		};
	        		 swarButton27.setPosition(120, 753 );
	        		 this.registerTouchArea(swarButton27);
	        		 this.attachChild(swarButton27);
	        		 
	        	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	        	 	 	
	        	        {                      
	        	            @Override
	        	            public void onTimePassed(final TimerHandler pTimerHandler)
	        	            {
	        	            	if(showFlag==0){
	        	            	unregisterTouchArea(swarButton27);
	        	            	detachChild(swarButton27);
	        	            	 swarCFlag=0;   
	        	            	 showFlag=1;
	        	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	        	            	}
	        	            }
	        	        })); 
	    		

		}break;
		
		case 28:{
			final Swarchakra swarButton28 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0932", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
        	Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-398);
          		 y=(int) ((int)pSceneTouchEvent.getY()-962);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0932",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-398);
       		 y=(int) ((int)pSceneTouchEvent.getY()-962);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[28]==28){ 
        	    		
        	    	    activity.pos=activity.position[27];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[27]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[27],l);
        					
        	    	    setLetter(activity.position[27],l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[27],c, block );
        			    activity.key[28]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key28");
        	    		}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[171]==171 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[170];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[170]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[170],l);
        					
        			    setLetter( activity.position[170], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[170],c, block );
        			    activity.key[171]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[170]==170 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[169];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[169]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[169],l);
        					
        			    setLetter( activity.position[169], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[169],c, block );
        			    activity.key[170]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[174]==174 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[173];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[173]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[173],l);
        					
        			    setLetter( activity.position[173], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[173],c, block );
        			    activity.key[174]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[173]==173 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[172];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[172]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[172],l);
        					
        			    setLetter( activity.position[172], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[172],c, block );
        			    activity.key[173]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[172]==172 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[171];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[171]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[171],l);
        					
        			    setLetter( activity.position[171], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[171],c, block );
        			    activity.key[172]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		case 3:
        			if( activity.key[340]==340 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[339];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[339]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[339],l);
        					
        			    setLetter( activity.position[339], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[339],c, block );
        			    activity.key[340]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[341]==341 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[340];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[340]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[340],l);
        					
        			    setLetter( activity.position[340], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[340],c, block );
        			    activity.key[341]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[342]==342 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[341];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[341]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[341],l);
        					
        			    setLetter( activity.position[341], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[341],c, block );
        			    activity.key[342]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[343]==343 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[342];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[342]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[342],l);
        					
        			    setLetter( activity.position[342], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[342],c, block );
        			    activity.key[343]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[344]==344 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[343];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[343]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[343],l);
        					
        			    setLetter( activity.position[343], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[343],c, block );
        			    activity.key[344]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;	
        		}
        	}
	    	
	    	     
	        Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton28.setPosition(237, 753 );
    		 this.registerTouchArea(swarButton28);
    		 this.attachChild(swarButton28);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton28);
    	            	detachChild(swarButton28);
    	            	 swarCFlag=0;    
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 
		}break;
		
		
		case 29:{
			final Swarchakra swarButton29 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0935", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
        	Flag=1;
	    	Blocks block;
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-511);
          		 y=(int) ((int)pSceneTouchEvent.getY()-962);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0935",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-511);
       		 y=(int) ((int)pSceneTouchEvent.getY()-962);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[29]==29){ 
        	    		
        	    	    activity.pos=activity.position[28];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[28]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[28],l);
        					
        	    	
        	    	    setLetter(activity.position[28],l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[28],c, block );
        			    activity.key[29]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key29");
        	    		}break;
        			
        			
        			
        		case 1: 
        			if( activity.key[176]==176 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[175];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[175]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[175],l);
        					
        			    setLetter( activity.position[175], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[175],c, block );
        			    activity.key[176]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ki");
        			}break;
        			
        			

        			
        		case 2:
        			if( activity.key[175]==175 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[174];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[174]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[174],l);
        					
        			    setLetter( activity.position[174], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[174],c, block );
        			    activity.key[175]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kA");
        			}break;
        			
        		case 8:
        			if( activity.key[179]==179 && activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[178];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[178]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[178],l);
        					
        			    setLetter( activity.position[178], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[178],c, block );
        			    activity.key[179]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[178]==178 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[177];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[177]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[177],l);
        					
        			    setLetter( activity.position[177], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[177],c, block );
        			    activity.key[178]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ke");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[177]==177 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[176];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[176]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[176],l);
        					
        			    setLetter( activity.position[176], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[176],c, block );
        			    activity.key[177]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		case 3:
        			if( activity.key[345]==345 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[344];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[344]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[344],l);
        					
        			    setLetter( activity.position[344], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[344],c, block );
        			    activity.key[345]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[346]==346 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[345];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[345]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[345],l);
        					
        			    setLetter( activity.position[345], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[345],c, block );
        			    activity.key[346]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[347]==347 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[346];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[346]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[346],l);
        					
        			    setLetter( activity.position[346], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[346],c, block );
        			    activity.key[347]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[348]==348 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[347];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[347]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[347],l);
        					
        			    setLetter( activity.position[347], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[347],c, block );
        			    activity.key[348]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[349]==349 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[348];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[348]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[348],l);
        					
        			    setLetter( activity.position[348], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[348],c, block );
        			    activity.key[349]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;	
        				
        		}
        	}
	    	Flag=0;
	        return true;
			
	        	}
	        	
	        		};
	        		 swarButton29.setPosition(354, 753 );
	        		 this.registerTouchArea(swarButton29);
	        		 this.attachChild(swarButton29);
	        		 
	        	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	        	 	 	
	        	        {                      
	        	            @Override
	        	            public void onTimePassed(final TimerHandler pTimerHandler)
	        	            {
	        	            	if(showFlag==0){
	        	            	unregisterTouchArea(swarButton29);
	        	            	detachChild(swarButton29);
	        	            	 swarCFlag=0;  
	        	            	 showFlag=1;
	        	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	        	            	}
	        	            }
	        	        })); 

		}
		break;
		
		case 30:{
			final Swarchakra swarButton30 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0936", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            
        	Flag=1;
	    	Blocks block;
	    	
	    	int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-624);
          		 y=(int) ((int)pSceneTouchEvent.getY()-962);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0936",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-624);
       		 y=(int) ((int)pSceneTouchEvent.getY()-962);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[30]==30){ 
        	    		
        	    	    activity.pos=activity.position[29];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[29]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[29],l);
        					
        	    	
        	    	    setLetter(activity.position[29],l,block);
        	    	    
        		    	Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[29],c, block );
        			    activity.key[30]=0;
        	    	    
        			    nodeFlag=0;
        			    Log.v("LEVEL","key30");
        	    		}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[181]==181 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[180];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[180]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[180],l);
        					
        			    setLetter( activity.position[180], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[180],c, block );
        			    activity.key[181]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[180]==180 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[179];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[179]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[179],l);
        					
        			    setLetter( activity.position[179], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[179],c, block );
        			    activity.key[180]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[184]==184 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[183];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[183]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[183],l);
        					
        			    setLetter( activity.position[183], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[183],c, block );
        			    activity.key[184]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[183]==183 && activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[182];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[182]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[182],l);
        					
        			    setLetter( activity.position[182], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[182],c, block );
        			    activity.key[183]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[182]==182 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[181];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[181]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[181],l);
        					
        			    setLetter( activity.position[181], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[181],c, block );
        			    activity.key[182]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[350]==350&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[349];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[349]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[349],l);
        					
        			    setLetter( activity.position[349], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[349],c, block );
        			    activity.key[350]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[351]==351 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[350];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[350]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[350],l);
        					
        			    setLetter( activity.position[350], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[350],c, block );
        			    activity.key[351]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[352]==352 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[351];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[351]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[351],l);
        					
        			    setLetter( activity.position[351], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[351],c, block );
        			    activity.key[352]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[353]==353 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[352];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[352]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[352],l);
        					
        			    setLetter( activity.position[352], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[352],c, block );
        			    activity.key[353]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[354]==354 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[353];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[353]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[353],l);
        					
        			    setLetter( activity.position[353], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[353],c, block );
        			    activity.key[354]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;		
        		}
        	}
	    	Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton30.setPosition(471, 753 );
    		 this.registerTouchArea(swarButton30);
    		 this.attachChild(swarButton30);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton30);
    	            	detachChild(swarButton30);
    	            	 swarCFlag=0;   
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 
		}break;
		
		case 31:{
			final Swarchakra swarButton31 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0937", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
			Flag=1;
			Blocks block;
			
			int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-172);
          		 y=(int) ((int)pSceneTouchEvent.getY()-1048);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0937",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-172);
       		 y=(int) ((int)pSceneTouchEvent.getY()-1048);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[31]==31){ 
			    		
        				activity.pos=activity.position[30];
        				block=new Blocks();
        				block.sprite.setColor(activity.letterblock[activity.position[30]].sprite.getColor());
        									
        				Letter_Blocks l= new Letter_Blocks();
        				color_match(activity.position[30],l);
        									
        					    	
        				setLetter(activity.position[30],l,block);

        				Color c= block.sprite.getColor();
        							    
        				node(activity.position[30],c, block );
        				activity.key[31]=0;
        					    	    
        				nodeFlag=0;
        				Log.v("LEVEL","key31");
        				}break;
        			
        			
        			
        		case 1: 
        			if( activity.key[186]==186 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[185];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[185]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[185],l);
        					
        			    setLetter( activity.position[185], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[185],c, block );
        			    activity.key[186]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ki");
        			}break;
        			
        			

        			
        		case 2:
        			if( activity.key[185]==185 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[184];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[184]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[184],l);
        					
        			    setLetter( activity.position[184], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[184],c, block );
        			    activity.key[185]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kA");
        			}break;
        			
        		case 8:
        			if( activity.key[189]==189 && activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[188];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[188]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[188],l);
        					
        			    setLetter( activity.position[188], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[188],c, block );
        			    activity.key[189]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[188]==188 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[187];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[187]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[187],l);
        					
        			    setLetter( activity.position[187], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[187],c, block );
        			    activity.key[188]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ke");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[187]==187 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[186];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[186]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[186],l);
        					
        			    setLetter( activity.position[186], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[186],c, block );
        			    activity.key[187]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[355]==355 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[354];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[354]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[354],l);
        					
        			    setLetter( activity.position[354], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[354],c, block );
        			    activity.key[355]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[356]==356 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[355];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[355]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[355],l);
        					
        			    setLetter( activity.position[355], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[355],c, block );
        			    activity.key[356]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[357]==357 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[356];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[356]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[356],l);
        					
        			    setLetter( activity.position[356], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[356],c, block );
        			    activity.key[357]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[358]==358 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[357];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[357]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[357],l);
        					
        			    setLetter( activity.position[357], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[357],c, block );
        			    activity.key[358]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[359]==359 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[358];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[358]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[358],l);
        					
        			    setLetter( activity.position[358], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[358],c, block );
        			    activity.key[359]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;	
        		}
        	}
			Flag=0;

	        return true;
			
    	}
    	
    		};
    		 swarButton31.setPosition(3, 839 );
    		 this.registerTouchArea(swarButton31);
    		 this.attachChild(swarButton31);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton31);
    	            	detachChild(swarButton31);
    	            	 swarCFlag=0;   
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 

		}break;
		
		case 32:{
			final Swarchakra swarButton32 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0938", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	           	swarCFlag=1;
			Flag=1;
			Blocks block;
			
			int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-285);
          		 y=(int) ((int)pSceneTouchEvent.getY()-1048);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0938",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-285);
       		 y=(int) ((int)pSceneTouchEvent.getY()-1048);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[32]==32){ 

        				activity.pos=activity.position[31];
        				block=new Blocks();
        				block.sprite.setColor(activity.letterblock[activity.position[31]].sprite.getColor());

        				Letter_Blocks l= new Letter_Blocks();
        				color_match(activity.position[31],l);


        				setLetter(activity.position[31],l,block);

        				Color c= block.sprite.getColor();

        				node(activity.position[31],c, block );
        				activity.key[32]=0;

        				nodeFlag=0;
        				Log.v("LEVEL","key32");
        				}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[191]==191 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[190];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[190]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[190],l);
        					
        			    setLetter( activity.position[190], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[190],c, block );
        			    activity.key[191]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[190]==190 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[189];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[189]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[189],l);
        					
        			    setLetter( activity.position[189], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[189],c, block );
        			    activity.key[190]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[194]==194 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[193];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[193]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[193],l);
        					
        			    setLetter( activity.position[193], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[193],c, block );
        			    activity.key[194]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[193]==193 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[192];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[192]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[192],l);
        					
        			    setLetter( activity.position[192], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[192],c, block );
        			    activity.key[193]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[192]==192 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[191];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[191]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[191],l);
        					
        			    setLetter( activity.position[191], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[191],c, block );
        			    activity.key[192]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		case 3:
        			if( activity.key[360]==360&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[359];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[359]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[359],l);
        					
        			    setLetter( activity.position[359], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[359],c, block );
        			    activity.key[360]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[361]==361 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[360];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[360]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[360],l);
        					
        			    setLetter( activity.position[360], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[360],c, block );
        			    activity.key[361]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[362]==362 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[361];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[361]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[361],l);
        					
        			    setLetter( activity.position[361], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[361],c, block );
        			    activity.key[362]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[363]==363 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[362];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[362]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[362],l);
        					
        			    setLetter( activity.position[362], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[362],c, block );
        			    activity.key[363]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[364]==364 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[363];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[363]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[363],l);
        					
        			    setLetter( activity.position[363], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[363],c, block );
        			    activity.key[364]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;	
        			
        		}
        	}
			Flag=0;
			
	        return true;
			
    	}
    	
    		};
    		 swarButton32.setPosition(120, 839 );
    		 this.registerTouchArea(swarButton32);
    		 this.attachChild(swarButton32);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton32);
    	            	detachChild(swarButton32);
    	            	 swarCFlag=0;
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 
		}break;
		
		case 33:{
			final Swarchakra swarButton33 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0939", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	swarCFlag=1;
			Flag=1;
			Blocks block;
			
			int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-398);
          		 y=(int) ((int)pSceneTouchEvent.getY()-1048);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
        		preview("\u0939",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-398);
       		 y=(int) ((int)pSceneTouchEvent.getY()-1048);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[33]==33){ 

        				activity.pos=activity.position[32];
        				block=new Blocks();
        				block.sprite.setColor(activity.letterblock[activity.position[32]].sprite.getColor());

        				Letter_Blocks l= new Letter_Blocks();
        				color_match(activity.position[32],l);


        				setLetter(activity.position[32],l,block);

        				Color c= block.sprite.getColor();

        				node(activity.position[32],c, block );
        				activity.key[33]=0;

        				nodeFlag=0;
        				Log.v("LEVEL","key33");
        				}break;
        			
        			
        			
        		case 1: 
        			if( activity.key[196]==196 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[195];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[195]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[195],l);
        					
        			    setLetter( activity.position[195], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[195],c, block );
        			    activity.key[196]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ki");
        			}break;
        			
        			

        			
        		case 2:
        			if( activity.key[195]==195 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[194];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[194]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[194],l);
        					
        			    setLetter( activity.position[194], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[194],c, block );
        			    activity.key[195]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kA");
        			}break;
        			
        		case 8:
        			if( activity.key[199]==199&& activity.level!=3 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[198];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[198]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[198],l);
        					
        			    setLetter( activity.position[198], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[198],c, block );
        			    activity.key[199]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[198]==198 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[197];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[197]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[197],l);
        					
        			    setLetter( activity.position[197], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[197],c, block );
        			    activity.key[198]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","ke");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[197]==197 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[196];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[196]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[196],l);
        					
        			    setLetter( activity.position[196], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[196],c, block );
        			    activity.key[197]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		case 3:
        			if( activity.key[365]==365 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[364];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[364]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[364],l);
        					
        			    setLetter( activity.position[364], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[364],c, block );
        			    activity.key[365]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[366]==366 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[365];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[365]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[365],l);
        					
        			    setLetter( activity.position[365], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[365],c, block );
        			    activity.key[366]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[367]==367 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[366];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[366]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[366],l);
        					
        			    setLetter( activity.position[366], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[366],c, block );
        			    activity.key[367]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[368]==368 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[367];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[367]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[367],l);
        					
        			    setLetter( activity.position[367], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[367],c, block );
        			    activity.key[368]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[369]==369 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[368];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[368]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[368],l);
        					
        			    setLetter( activity.position[368], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[368],c, block );
        			    activity.key[369]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;		
        		}
        	}
			
			Flag=0;
			return true;
			
	        	}
	        	
	        		};
	        		 swarButton33.setPosition(237, 839 );
	        		 this.registerTouchArea(swarButton33);
	        		 this.attachChild(swarButton33);
	        		 
	        	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
	        	 	 	
	        	        {                      
	        	            @Override
	        	            public void onTimePassed(final TimerHandler pTimerHandler)
	        	            {
	        	            	if(showFlag==0){
	        	            	unregisterTouchArea(swarButton33);
	        	            	detachChild(swarButton33);
	        	            	 swarCFlag=0;    
	        	            	 showFlag=1;
	        	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
	        	            	}
	        	            }
	        	        })); 

		}break;
		
		case 34:{
			final Swarchakra swarButton34 = new Swarchakra(activity.mSwarRegion, activity.mFont, "\u0933", 0.4f, 0.4f, 0.4f,1){
	            @Override
	            public boolean onAreaTouched(final TouchEvent pSceneTouchEvent, final float pTouchAreaLocalX, final float pTouchAreaLocalY) {

	            	 swarCFlag=1;   	
			Flag=1;
			Blocks block;
			
			int x=0,y=0;
    		int radius=0,theta=0,theRegion;
    		
    		
        	if(pSceneTouchEvent.getAction()== MotionEvent.ACTION_MOVE||pSceneTouchEvent.getAction()==MotionEvent.ACTION_OUTSIDE){
        	
        		x= (int) ((int)pSceneTouchEvent.getX()-511);
          		 y=(int) ((int)pSceneTouchEvent.getY()-1048);
          		 radius = (int) Math.sqrt((x*x)+(y*y));
          		 theta =(int) Math.toDegrees(Math.atan2(x,y));
          		 theRegion = findRegion(radius,theta);
          		 preview("\u0933",theRegion,this);
        	}
        	else
        	if(pSceneTouchEvent.getAction()== TouchEvent.ACTION_UP){
        		showFlag=0;
        		previewflag=0;
        	 x= (int) ((int)pSceneTouchEvent.getX()-511);
       		 y=(int) ((int)pSceneTouchEvent.getY()-1048);
       		 radius = (int) Math.sqrt((x*x)+(y*y));
       		 theta =(int) Math.toDegrees(Math.atan2(x,y));
       		 theRegion = findRegion(radius,theta);
        		
            
        		switch(theRegion){
        		case 0:
        			if(activity.key[34]==34){ 

        				activity.pos=activity.position[33];
        				block=new Blocks();
        				block.sprite.setColor(activity.letterblock[activity.position[33]].sprite.getColor());

        				Letter_Blocks l= new Letter_Blocks();
        				color_match(activity.position[33],l);


        				setLetter(activity.position[33],l,block);

        				Color c= block.sprite.getColor();

        				node(activity.position[33],c, block );
        				activity.key[34]=0;

        				nodeFlag=0;
        				Log.v("LEVEL","key34");
        				}break;
        	    	   
        	        
        			
        			
        			
        		case 1: 
        			if( activity.key[201]==201 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[200];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[200]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[200],l);
        					
        			    setLetter( activity.position[200], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[200],c, block );
        			    activity.key[201]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khi");
        			}break;
        			

        			
        		case 2:
        			if( activity.key[200]==200 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[199];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[199]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[199],l);
        					
        			    setLetter( activity.position[199], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[199],c, block );
        			    activity.key[200]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khA");
        			}break;
        			
        		case 8:
        			if( activity.key[204]==204 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[203];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[203]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[203],l);
        					
        			    setLetter( activity.position[203], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[203],c, block );
        			    activity.key[204]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","kAy");
        			}break;
        			
        		case 9:
        			if( activity.key[203]==203 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[202];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[202]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[202],l);
        					
        			    setLetter( activity.position[202], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[202],c, block );
        			    activity.key[203]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khe");
        			}break;
        			
        		case 10:
        	
        			if( activity.key[202]==202 ){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[201];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[201]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[201],l);
        					
        			    setLetter( activity.position[201], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[201],c, block );
        			    activity.key[202]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","khii");
        			}break;
/*-------------------------------------------------------------------------------------------------------------------------*/
        		
        		case 3:
        			if( activity.key[370]==370 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[369];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[369]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[369],l);
        					
        			    setLetter( activity.position[369], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[369],c, block );
        			    activity.key[370]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","halant");
        			}break;
        			
        		case 4:
        			if( activity.key[371]==371 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[370];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[370]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[370],l);
        					
        			    setLetter( activity.position[370], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[370],c, block );
        			    activity.key[371]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","uu");
        			}break;
        			
        		case 5:
        			if( activity.key[372]==372 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[371];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[371]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[371],l);
        					
        			    setLetter( activity.position[371], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[371],c, block );
        			    activity.key[372]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","u");
        			}break;
        			
        		case 6:
        			if( activity.key[373]==373 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[372];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[372]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[372],l);
        					
        			    setLetter( activity.position[372], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[372],c, block );
        			    activity.key[373]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","awe");
        			}break;
        			
        		case 7:
        			if( activity.key[374]==374 && activity.level!=3){
        				KeyFlag=1;	
                        
                     	activity.pos=activity.position[373];
        		    	block=new Blocks();
        			    block.sprite.setColor(activity.letterblock[activity.position[373]].sprite.getColor());
        					
        		        Letter_Blocks l= new Letter_Blocks();
        			    color_match(activity.position[373],l);
        					
        			    setLetter( activity.position[373], l,block);
        		    	
        			    Color c= block.sprite.getColor();
        			    
        		    	node(activity.position[373],c, block );
        			    activity.key[374]=0;
        			    nodeFlag=0;
        			    Log.v("LEVEL","o");
        			}break;		
        			
        		}
        	}
			Flag=0;

			return true;
			
    	}
    	
    		};
    		 swarButton34.setPosition(354, 839 );
    		 this.registerTouchArea(swarButton34);
    		 this.attachChild(swarButton34);
    		 
    	      activity.getEngine().registerUpdateHandler(new TimerHandler(1,true, new ITimerCallback()		
    	 	 	
    	        {                      
    	            @Override
    	            public void onTimePassed(final TimerHandler pTimerHandler)
    	            {
    	            	if(showFlag==0){
    	            	unregisterTouchArea(swarButton34);
    	            	detachChild(swarButton34);
    	            	 swarCFlag=0;    
    	            	 showFlag=1;
    	            	 activity.getEngine().unregisterUpdateHandler(pTimerHandler);
    	            	}
    	            }
    	        })); 

		}break;
		
		
		default:deduct_score();
		 	 
		}
		
		}
		
	}
	
	
	
	
	public GameScene(){
		activity = StartActivity.getSharedInstance();
		setBackground(new Background(1, 1, 1));
		str=activity.str="";
		
        activity.pos=0;
		activity.key=new int[400];
		activity.position=new int[400];
		for(int i=0;i<100;i++){
			activity.key[i]=0;
			activity.position[i]=0;
		}
	
		
		activity.lev1=new int[7];
		color_lev1=new Color[7];
		
		paint.setColor(0);
	    scene=this;
		
	    
	    activity.score=0;

	   
		
        //The timer function
       createTimeHandler();


       //	Sound file

        activity.bgmusic.play();

        Sprite score = new Sprite(527, 12, activity.mScoreRegion, activity.getVertexBufferObjectManager());
        attachChild(score);  

        Text letter= new Text(0, 0, activity.tFont,"- " , activity.getVertexBufferObjectManager());
        letter.setColor(0, 0, 0);
        letter.setPosition(590,5);

        attachChild(letter);

        Text num_score= new Text(0, 0, activity.numFont,"\u0966" , activity.getVertexBufferObjectManager());
        num_score.setColor(0, 0, 0);
        num_score.setPosition(610,3);

        attachChild(num_score);

        if(activity.level<4){
        Text time=new Text(0,0,activity.numFont,"\u0967\u0968\u0966",activity.getVertexBufferObjectManager());
        time.setColor(0,0,0);
        time.setPosition(360, 3);
        attachChild(time);
        }
        else
        {
        	timer=240;
        	Text time=new Text(0,0,activity.numFont,"\u0968\u096A\u0966",activity.getVertexBufferObjectManager());
            time.setColor(0,0,0);
            time.setPosition(360, 3);
            attachChild(time);
        }
	    
	    
		mCamera = StartActivity.getSharedInstance().mCamera;
		block = Blocks.getSharedInstance();
	
		
		attachChild(new BlockLayer());
		attachChild(new BlockLayer(449));
	//	attachChild(new Keyboard(this));
		callKeyboard();
		KeyBoard= new Keyboard(this,"");
		
		
	
		
		this.setTouchAreaBindingOnActionMoveEnabled(true);
		
//		this.setTouchAreaBindingOnActionDownEnabled(true);
		this.setOnAreaTouchTraversalFrontToBack() ;
		
		
	}



}